Add a new pet to the store
POSThttps://petstore.swagger.io/v2/pet
Add new pet to the store inventory.
Request
Header Parameters
The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US
en-AU
Cookie Parameters
Some cookie
- application/json
- application/xml
Bodyrequired
Pet object that needs to be added to the store
- cat
- dog
- bee
category Category
The name given to a pet
Guru
The list of URL to a cute photos featuring pet
Possible values: <= 20
tags Tag[]required
Pet status in the store
Enum Value | Description |
---|---|
available | When the pet is available |
pending | When the pet is being sold |
sold | When the pet has been sold. These descriptions can contain line breaks and also links |
Possible values: [available
, pending
, sold
]
Type of a pet
Possible values: [cat
, dog
, bee
]
The measured skill for hunting
Possible values: [clueless
, lazy
, adventurous
, aggressive
]
lazy
adventurous
The size of the pack the dog is from
Possible values: >= 1
1
Average amount of honey produced per day in ounces
0
3.14
Bodyrequired
Pet object that needs to be added to the store
hooray
Responses
- 200
- 405
All good, here's some MDX:
Some content but no markdown is supported :(
Some content with Markdown syntax
. Check this api
.
Month | Savings |
---|---|
January | $250 |
February | $80 |
March | $420 |
Hmm.....
Some content with Markdown syntax
. Check this api
which is not supported :( yet
Some plain text
Some more plain text
And more
A code snippet!
print("hello")
And a table!
Month | Savings |
---|---|
January | $250 |
February | $80 |
March | $420 |
- application/json
- Schema
- Example (auto)
Schema
data object
{
"data": "string"
}
Invalid input
Authorization: oauth2
name: petstore_authtype: oauth2scopes:write:pets,read:pets
description: Get access to data while protecting your account credentials. OAuth2 is also a safer and more secure way to give you access.flows: { "implicit": { "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog", "scopes": { "write:pets": "modify pets in your account", "read:pets": "read your pets" } } }
- python
- curl
- csharp
- go
- nodejs
- ruby
- php
- java
- powershell
- dart
- javascript
- c
- objective-c
- ocaml
- r
- swift
- kotlin
- rust
- HTTP.CLIENT
- REQUESTS
import http.client
import json
conn = http.client.HTTPSConnection("petstore.swagger.io")
payload = json.dumps({
"category": {
"name": "string",
"sub": {
"prop1": "string"
}
},
"name": "Guru",
"photoUrls": [
"string"
],
"friend": {},
"tags": [
{
"name": "string"
}
],
"status": "available",
"petType": {
"huntingSkill": "adventurous"
}
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}
conn.request("POST", "/v2/pet", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))