uploads an image
1 min
POST
https://petstore3.swagger.io/api/v3/pet/{petId}/uploadImage
Path Parameters
- petIdinteger<int64>requiredDescription
Query Parameters
- additionalMetadatastringDescription
Responses
200
- ApiResponse
- codeinteger<int32>
- typestring
- messagestring
curl
curl --request POST \
--url https://petstore3.swagger.io/api/v3/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("https://petstore3.swagger.io/api/v3/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("https://petstore3.swagger.io/api/v3/pet/{petId}/uploadImage")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/octet-stream"
response = https.request(request)
puts response.read_body
python
import requests
url = "https://petstore3.swagger.io/api/v3/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": ""
}Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.