cURL DELETE Request with Examples

In order to perform cURL request to delete a resource at the server side, you can make use of the -X DELETE option along with the cURL command on the console/terminal.

curl -X DELETE

As such requests require authentication, you can add header detail to the request for authentication basic/bearer token (if supported by the server) as follows,

Example: Basic Auth
curl -X DELETE -H "Authorization: Basic BASE64_ENCODED_CREDENTIALS"

Example: OAuth 2.0 Bearer Token
curl -X DELETE -H "Authorization: Bearer TOKEN"

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright ยฉ Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap