addPet
POST
/pets
fetch('http://petstore.swagger.io/api/pets', { method: 'POST', body: JSON.stringify({ name: 'Fido' })})import requestsrequests.post('http://petstore.swagger.io/api/pets', json={'name': 'Fido'})Creates a new pet in the store. Duplicates are allowed
Request Body
Section titled “Request Body”Pet to add to the store
Media typeapplication/json
object
name
required
string
tag
string
Examplegenerated
{ "name": "example", "tag": "example"}Responses
Section titled “Responses”Pet response
Media typeapplication/json
object
name
required
string
tag
string
id
required
integer format: int64
Examplegenerated
{ "name": "example", "tag": "example", "id": 1}default
Section titled “default”Unexpected error
Media typeapplication/json
object
code
required
integer format: int32
message
required
string
Examplegenerated
{ "code": 1, "message": "example"}