Updates a pet in the store with form data
1 min
POST
//petstore.swagger.io/v2/pet/{petId}
Path Parameters
- petIdinteger<int64>requiredDescription
Form Parameters
- namestringDescription
- statusstringDescription
Responses
405
curl
curl --request POST \
--url //petstore.swagger.io/v2/pet/{petId} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/x-www-form-urlencoded");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("//petstore.swagger.io/v2/pet/{petId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "net/http"
url = URI("//petstore.swagger.io/v2/pet/{petId}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/x-www-form-urlencoded"
response = http.request(request)
puts response.read_body
python
import requests
url = "//petstore.swagger.io/v2/pet/{petId}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
405
// Invalid input