Accepts only DELETE and echoes any body sent with it
DELETE
https://api.testingapis.com/api/methods/deleteResponses
- 200
- Method, query, content type and body.
- 405
- Any other verb.
Example
Request
curl -X DELETE "https://api.testingapis.com/api/methods/delete"Response200 OK
{
"method": "DELETE",
"message": "DELETE request received",
"path": "/api/methods/delete",
"query": {},
"contentType": null,
"bodyLength": 0,
"bodyTruncated": false,
"body": null,
"timestamp": "2026-09-30T18:26:47Z"
}Code examples
JavaScript (fetch)
const response = await fetch("https://api.testingapis.com/api/methods/delete", {
method: "DELETE",
});
console.log(response.status, await response.text());Python (requests)
import requests
response = requests.request(
"DELETE",
"https://api.testingapis.com/api/methods/delete",
allow_redirects=False,
)
print(response.status_code, response.text)Java (HttpClient)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.followRedirects(HttpClient.Redirect.NEVER)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.testingapis.com/api/methods/delete"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}