Deletes a pet
1 min
DELETE
//petstore.swagger.io/v2/pet/{petId}
Path Parameters
- petIdintegerrequiredDescription
Header Parameters
- api_keystringExample
Responses
400
curl
curl --location --globoff --request DELETE '//petstore.swagger.io/v2/pet/{petId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'DELETE',
headers: myHeaders,
redirect: 'follow'
};
fetch("//petstore.swagger.io/v2/pet/{petId}", 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/pet/{petId}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "//petstore.swagger.io/v2/pet/{petId}"
payload = {}
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
400
// Invalid pet value
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.