Update an existing pet.
PUT
/pet
curl -X PUT 'https://petstore3.swagger.io/api/v3/pet' \ -H 'Content-Type: application/json' \ -d '{"category":{"id":1,"name":"Dogs"},"id":10,"name":"doggie","photoUrls":["string"],"status":"available","tags":[{"id":0,"name":"string"}]}'package main
import ( "context" "net/http" "strings")
func main() { ctx := context.Background() body := strings.NewReader(`{"category":{"id":1,"name":"Dogs"},"id":10,"name":"doggie","photoUrls":["string"],"status":"available","tags":[{"id":0,"name":"string"}]}`) req, err := http.NewRequestWithContext(ctx, "PUT", "https://petstore3.swagger.io/api/v3/pet", 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( "PUT", "https://petstore3.swagger.io/api/v3/pet", headers={"Content-Type": "application/json"}, data='{"category":{"id":1,"name":"Dogs"},"id":10,"name":"doggie","photoUrls":["string"],"status":"available","tags":[{"id":0,"name":"string"}]}',)print(response.json())const response = await fetch('https://petstore3.swagger.io/api/v3/pet', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({"category":{"id":1,"name":"Dogs"},"id":10,"name":"doggie","photoUrls":["string"],"status":"available","tags":[{"id":0,"name":"string"}]}),});const data = await response.json();Update an existing pet by Id.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Update an existent pet in the store
object
category
object
id
integer format: int64
Example
1 name
string
Example
Dogs id
integer format: int64
Example
10 name
required
string
Example
doggie photoUrls
required
Array<string>
status
Pet status in the store
string
tags
Array<object>
object
id
integer format: int64
name
string
object
category
object
id
integer format: int64
Example
1 name
string
Example
Dogs id
integer format: int64
Example
10 name
required
string
Example
doggie photoUrls
required
Array<string>
status
Pet status in the store
string
tags
Array<object>
object
id
integer format: int64
name
string
object
category
object
id
integer format: int64
Example
1 name
string
Example
Dogs id
integer format: int64
Example
10 name
required
string
Example
doggie photoUrls
required
Array<string>
status
Pet status in the store
string
tags
Array<object>
object
id
integer format: int64
name
string
Responses
Section titled “ Responses ”Successful operation
object
category
object
id
integer format: int64
name
string
id
integer format: int64
name
required
string
photoUrls
required
Array<string>
status
Pet status in the store
string
tags
Array<object>
object
id
integer format: int64
name
string
Example
{ "category": { "id": 1, "name": "Dogs" }, "id": 10, "name": "doggie", "status": "available"}object
category
object
id
integer format: int64
Example
1 name
string
Example
Dogs id
integer format: int64
Example
10 name
required
string
Example
doggie photoUrls
required
Array<string>
status
Pet status in the store
string
tags
Array<object>
object
id
integer format: int64
name
string
Invalid ID supplied
Pet not found
Validation exception
default
Section titled “default ”Unexpected error