Uploads an image.
POST
/pet/{petId}/uploadImage
curl -X POST 'https://petstore3.swagger.io/api/v3/pet/0/uploadImage?additionalMetadata=string' \ -H 'Content-Type: application/json' \ -d '"binary"'package main
import ( "context" "net/http" "strings")
func main() { ctx := context.Background() body := strings.NewReader(`"binary"`) req, err := http.NewRequestWithContext(ctx, "POST", "https://petstore3.swagger.io/api/v3/pet/0/uploadImage?additionalMetadata=string", body) if err != nil { panic(err) } req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close()}import requests
response = requests.request( "POST", "https://petstore3.swagger.io/api/v3/pet/0/uploadImage?additionalMetadata=string", headers={"Content-Type": "application/json"}, data='"binary"',)print(response.json())const response = await fetch('https://petstore3.swagger.io/api/v3/pet/0/uploadImage?additionalMetadata=string', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify("binary"),});const data = await response.json();Upload image of the pet.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” petId
required
integer format: int64
ID of pet to update
Query Parameters
Section titled “Query Parameters ” additionalMetadata
string
Additional Metadata
Request Body
Section titled “Request Body ” Media type application/octet-stream
string format: binary
Responses
Section titled “ Responses ”Successful operation
Media type application/json
object
code
integer format: int32
message
string
type
string
Example generated
{ "code": 1, "message": "example", "type": "example"}No file uploaded
Pet not found
default
Section titled “default ”Unexpected error