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,
- Hide cURL Outputs and Errors on Terminal
- cURL DELETE Request with Examples
- Downloading Google Chrome using cURL Command
- List of 28 Protocols supported by cURL with Examples
- Get the Size of HTTP Response using cURL Command (Content Length)
- How to convert a Postman request to cURL Command
- How to URL Encode Data for a cURL Request Parameters
- Get cURL command from Chrome Inspect Network HTTP URL
- Fetch only content-type using cURL Command
- cURL -d Option with Examples
- cURL Option to show HTTP Response Status Code
- URL Encode cURL HTTP GET\POST Data with Examples
- How to get cURL Command to run in verbose mode?
- trurl: A new command-line tool for URL parsing and manipulation by cURL Developer
- [fix] command not found curl
- How to Pretty Print cURL JSON Output in Terminal
- Capture cURL Request Output to a File
- List of common cURL Error Codes
- How to pass authorization header using cURL
- Perform Basic Authentication using cURL with Examples
- Trace using cURL Command Example
- Efficient way to perform HTTP cURL GET/POST Requests with Payload
- Save cURL Command Output to a external file
- cURL Example using IP (IPv4 and IPv6) address and Port
- How to follow redirects in cURL Command Request
More Posts:
- How to Toggle Dark Mode in Microsoft 365 Word App on Mac - Microsoft
- 9 Ways to Loop Java Map (HashMap) with Code Examples - Java
- Java: Convert Date Class Object to Calendar - Java
- Column Mode Editing in Notepad++ - NotepadPlusPlus
- Adding internet permission to Android Project - Android
- Java: Fix SAXParseException: :1:1: Content is not allowed in prolog. - Java
- [Fix] Office 365 Sharepoint One Drive Error: Something went wrong. This is a temporary issue - SharePoint
- JSON Schema Validator Libraries: JSON Tutorial - Json-Tutorial