Add a new pet to the store JUST FOR TEST BODY ARRay
1 min
PUT
//petstore.swagger.io/v2/example
Body Parameters
- bodyobject
- objectPet
- idIdDescription
- categoryCategoryDescription
- idIdDescription
- namestringDescription
- subobjectDescription
- prop1stringDescription
- namestringrequiredExampleDescriptionDefaultFluffyIsDefault
- photoUrlsstring,integer,nullrequiredDescription
- friendPet
- Circular-Reference
- tagsTag[]Description
- idIdDescription
- namestringDescription
- statusstring<available | pending | sold>DescriptionDefaultpending
- petTypestringExampleDescription
- huntingSkillinteger
- objectDog[]
- idIdDescription
- categoryCategoryDescription
- idIdDescription
- namestringDescription
- subobjectDescription
- prop1stringDescription
- namestringrequiredExampleDescriptionDefaultFluffyIsDefault
- photoUrlsstring,integer,nullrequiredDescription
- friendPet
- Circular-Reference
- tagsTag[]Description
- idIdDescription
- namestringDescription
- statusstring<available | pending | sold>DescriptionDefaultpending
- petTypestringExampleDescription
- huntingSkillinteger
- packSizeinteger<int32>requiredDescriptionDefault1
- objectHoneyBee
- idIdDescription
- categoryCategoryDescription
- idIdDescription
- namestringDescription
- subobjectDescription
- prop1stringDescription
- namestringrequiredExampleDescriptionDefaultFluffyIsDefault
- photoUrlsstring,integer,nullrequiredDescription
- friendPet
- Circular-Reference
- tagsTag[]Description
- idIdDescription
- namestringDescription
- statusstring<available | pending | sold>DescriptionDefaultpending
- petTypestringExampleDescription
- huntingSkillinteger
- honeyPerDaynumberrequiredExampleDescription
Responses
200
- ApiResponse
- codeinteger<int32>
- typestring
- messagestring
curl
curl --request PUT \
--url //petstore.swagger.io/v2/example \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"name": "FluffyIsDefault",
"photoUrls": "",
"status": "pending"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"name": "FluffyIsDefault",
"photoUrls": "",
"status": "pending"
});
var requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("//petstore.swagger.io/v2/example", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("//petstore.swagger.io/v2/example")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Put.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"name": "FluffyIsDefault",
"photoUrls": "",
"status": "pending"
})
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "//petstore.swagger.io/v2/example"
payload = json.dumps({
"name": "FluffyIsDefault",
"photoUrls": "",
"status": "pending"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
200
// successful operation
{
"code": "",
"type": "",
"message": ""
}GENERATED
// successful operation
{
"code": "",
"type": "",
"message": ""
}User Link Example
// User example in XML
// https://foo.bar/examples/user-example.xmluse2r
// User example in XML aaa
{
"name": "Fluffy",
"petType": "Cat",
"color": "White",
"gender": "male",
"breed": "Persian"
}Add new pet to the store inventory.