Creates list of users with given input array
1 min
POST
//petstore.swagger.io/v2/user/createWithList
Body Parameters
- bodyUser[]requiredDescription
- idId
- petobject
- Pet
- idIdDescription
- categoryCategoryDescription
- idIdDescription
- namestringDescription
- subobjectDescription
- prop1stringDescription
- namestringrequiredExampleDescriptionDefaultFluffyIsDefault
- photoUrlsstring,integer,nullrequiredDescription
- friendPet
- Circular-Reference
- tagsTag[]Description
- idIdDescription
- namestringDescription
- statusstring<available | pending | sold>DescriptionDefaultpending
- petTypestringExampleDescription
- huntingSkillinteger
- Tag
- idIdDescription
- namestringDescription
- usernamestringExampleDescription
- firstNamestringExampleDescription
- lastNamestringExampleDescription
- emailstring<email>ExampleDescription
- passwordstring<password>ExampleDescription
- phonestringExampleDescription
- userStatusinteger<int32>Description
- imagestringDescription
- addressesstring[]
Responses
default
curl
curl --request POST \
--url //petstore.swagger.io/v2/user/createWithList \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '[
{
"pet": {
"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([
{
"pet": {
"name": "FluffyIsDefault",
"photoUrls": "",
"status": "pending"
}
}
]);
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("//petstore.swagger.io/v2/user/createWithList", 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/user/createWithList")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump([
{
"pet": {
"name": "FluffyIsDefault",
"photoUrls": "",
"status": "pending"
}
}
])
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "//petstore.swagger.io/v2/user/createWithList"
payload = json.dumps([
{
"pet": {
"name": "FluffyIsDefault",
"photoUrls": "",
"status": "pending"
}
}
])
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
default
// successful operation