uploads an image
1 min
POST
//petstore.swagger.io/v2/pet/{petId}/uploadImage
Path Parameters
- petIdinteger<int64>requiredDescription
Responses
200
- ApiResponse
- codeinteger<int32>
- typestring
- messagestring
curl
curl --request POST \
--url //petstore.swagger.io/v2/pet/{petId}/uploadImage \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/octet-stream");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("//petstore.swagger.io/v2/pet/{petId}/uploadImage", 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}/uploadImage")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/octet-stream"
response = http.request(request)
puts response.read_body
python
import requests
url = "//petstore.swagger.io/v2/pet/{petId}/uploadImage"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/octet-stream'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// successful operation
{
"code": "",
"type": "",
"message": ""
}GENERATED
// successful operation
{
"code": "",
"type": "",
"message": ""
}user
// User example in XML
// https://foo.bar/examples/user-example.xmluse2r
// User example in XML aaa
{
"name": "Fluffy",
"petType": "Cat",
"color": "White",
"gender": "male",
"breed": "Persian"
}