Swagger Petstore REDOCLY 3.1
store
Place an order for a pet
1 min
code examples curl location '//petstore swagger io/v2/store/order' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "quantity" 1 }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "quantity" 1 }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("//petstore swagger io/v2/store/order", 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/store/order") 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({ "quantity" 1 }) response = http request(request) puts response read body import requests import json url = "//petstore swagger io/v2/store/order" payload = json dumps({ "quantity" 1 }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful operation { "id" 0, "petid" 0, "quantity" "", "shipdate" "", "status" "", "complete" false }// invalid order
🤔
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.