Swagger Petstore REDOCLY 3.1
user
Creates list of users with given input array
1 min
code examples curl location '//petstore swagger io/v2/user/createwitharray' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '\[ { "pet" { "name" "guru", "photourls" "", "status" "pending" } } ]'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify(\[ { "pet" { "name" "guru", "photourls" "", "status" "pending" } } ]); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("//petstore swagger io/v2/user/createwitharray", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("//petstore swagger io/v2/user/createwitharray") 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" "guru", "photourls" "", "status" "pending" } } ]) response = http request(request) puts response read body import requests import json url = "//petstore swagger io/v2/user/createwitharray" payload = json dumps(\[ { "pet" { "name" "guru", "photourls" "", "status" "pending" } } ]) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful operation
🤔
Have a question?
Our super-smart AI,knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.