curl --request POST \
--url https://petstore.swagger.io/v2/pet \
--body '{"id":"","category":{"id":"","name":""},"name":"doggie","photoUrls":[""],"tags":[{"id":"","name":""}],"status":""}'
fetch('https://petstore.swagger.io/v2/pet', {
method: 'POST',
body: {
"id": "",
"category": {
"id": "",
"name": ""
},
"name": "doggie",
"photoUrls": [
""
],
"tags": [
{
"id": "",
"name": ""
}
],
"status": ""
},
})
.then(e => e.json())
.then((data) => {
console.log('Request succeeded with JSON response', data);
})
.catch((error) => {
console.log('Request failed', error);
});
const request = require('request');
const options = {
method: 'POST',
url: 'https://petstore.swagger.io/v2/pet',
body: {
"id": "",
"category": {
"id": "",
"name": ""
},
"name": "doggie",
"photoUrls": [
""
],
"tags": [
{
"id": "",
"name": ""
}
],
"status": ""
},
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import requests
url = "https://petstore.swagger.io/v2/pet"
headers = {
}
body = {
"id": "",
"category": {
"id": "",
"name": ""
},
"name": "doggie",
"photoUrls": [
""
],
"tags": [
{
"id": "",
"name": ""
}
],
"status": ""
}
response = requests.POST(url, headers=headers, body=body)