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.


Example:
curl -X DELETE https://code2care.org/v2/api/user/151

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" https://code2care.org/v2/api/user/151

Example: OAuth 2.0 Bearer Token
curl -X DELETE -H "Authorization: Bearer TOKEN" https://code2care.org/v2/api/user/151

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: rakesh@code2care.org

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