Swagger Petstore REDOCLY 3.1
store
Subscribe to the Store events
1 min
code examples curl location '//petstore swagger io/v2/store/subscribe' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "callbackurl" "https //myserver com/send/callback/here", "eventname" "orderinprogress" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "callbackurl" "https //myserver com/send/callback/here", "eventname" "orderinprogress" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("//petstore swagger io/v2/store/subscribe", 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/subscribe") 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({ "callbackurl" "https //myserver com/send/callback/here", "eventname" "orderinprogress" }) response = http request(request) puts response read body import requests import json url = "//petstore swagger io/v2/store/subscribe" payload = json dumps({ "callbackurl" "https //myserver com/send/callback/here", "eventname" "orderinprogress" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful operation \[ \[ "" ] ]// subscription added { "subscriptionid" "aaa 123 bbb 456" }
🤔
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.