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!
More Posts related to cURL,
- cURL Option to show HTTP Response Status Code
- URL Encode cURL HTTP GET\POST Data with Examples
- Capture cURL Request Output to a File
- Fix: Curl No Match Found Error
- trurl: A new command-line tool for URL parsing and manipulation by cURL Developer
- Send JSON Data as Payload using cURL HTTP POST Request
- cURL: Show Request and Response Headers
- Get cURL command from Chrome Inspect Network HTTP URL
- Save cURL Command Output to a external file
- cURL DELETE Request with Examples
- How to URL Encode Data for a cURL Request Parameters
- cURL Example using IP (IPv4 and IPv6) address and Port
- How to convert a Postman request to cURL Command
- [fix] command not found curl
- How to Pretty Print cURL JSON Output in Terminal
- How to follow redirects in cURL Command Request
- How to pass authorization header using cURL
- cURL -x Use of HTTP Proxy Server Examples
- Downloading Google Chrome using cURL Command
- How to get cURL Command to run in verbose mode?
- List of 28 Protocols supported by cURL with Examples
- Hide cURL Outputs and Errors on Terminal
- cURL -d Option with Examples
- How to show SSL Certificate details using cURL Command
- Perform Basic Authentication using cURL with Examples
More Posts:
- Your JBoss Application Server 7 is running However you have not yet added any users to be able to access the admin console - Java
- How to retrieve all SharePoint Online List Items using Rest API - SharePoint
- How to Open Notepad as Administrator on Windows 11 - Windows
- Implementing Selection Sort Algorithm as Java Program - Java
- Fix - zsh: command not found: pip - zsh
- How to Change Mac Computer and Localhost Name using Terminal - MacOS
- Integrating WhatsApp with Android Application using Intent (Java/Kotlin) - Android
- Unable to find image docker latest locally - Docker