Curl - Delete a resource using the -X or --request DELETE option
by
Jeremy Canfield |
Updated: June 24 2022
| Curl articles
The curl command with the -X or --request DELETE option is used to send a delete request to a server. The server could be a web server or an FTP server.
out any options will display the contents of a file on a server. The server could be a web server or an FTP server. In this example, the index.html file on the www.example.com web server is deleted.
curl -X DELETE http://www.example.com/index.html
--url
The --url option is used to define the URL being requested. This option is typically not needed, thus the following commands both display the contents of the index.html page from the www.example.com web server.
curl -X DELETE http://www.example.com/index.html
curl -X DELETE --url http://www.example.com/index.html
Did you find this article helpful?
If so, consider buying me a coffee over at
Comments
November 14 2019 by raja
nothing
March 01 2020 by Ari
Informação correta! funcionou normalmente e me ajudou muito obrigado por compartilhar informação, e parabéns pela atitude.