How to send a DELETE request using cURL?

You can send a DELETE request using cURL via the following command:

curl -X DELETE <url>

Where:

  • -X flag is used to define the request method that cURL should use. By default cURL sends a GET request.

Replace <url> with the URL of the resource you want to delete. Here is a sample command that sends a DELETE request to our hosted version of HTTPBin:

$ curl -X DELETE "https://httpbin.scrapingbee.com/delete"

What is cURL?

cURL is an open-source command-line tool used to transfer data to and from a server. It is extremely versatile and supports various protocols including HTTP, FTP, SMTP, and many others. It is generally used to test and interact with APIs, download files, and perform various other tasks involving network communication.

What is a DELETE request?

An HTTP DELETE request is a method used in the Hypertext Transfer Protocol (HTTP) to request the deletion of a specified resource on a server.

The DELETE method specifically requests that a resource, identified by the given URL (Uniform Resource Locator), be removed from the server.

Related curl web scraping questions: