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: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap