DELETE method- Python requests Read Courses Practice Improve Improve Improve Like Article Like Save Article Save Report issue Report Requests library is one of the important aspects of Python for making HTTP requests to a specified URL. This article revolves around how one can make DELETE request to a specified URL using requests.delete() method. Before checking out the DELETE method, let’s figure out what a Http DELETE request is – DELETE Http Method DELETE is a request method supported by HTTP used by the World Wide Web. The DELETE method deletes the specified resource. As with a PUT request, you need to specify a particular resource for this operation. A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity. An example URI looks like for delete operation http://www.example.com/articles/12345 How to make DELETE request through Python Requests Python’s requests module provides in-built method called delete() for making a DELETE request to a specified URI. Syntax – requests.delete(url, params={key: value}, args) Example – Let’s try making a request to httpbin’s APIs for example purposes. import requests # Making a DELETE request r = requests.delete('https://httpbin.org / delete', data ={'key':'value'}) # check status code for response received # success code - 200 print(r) # print content of request print(r.json()) save this file as request.py and through terminal run, python request.py Output – Advanced with DELETE request The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation has been carried out, even if the status code returned from the origin server indicates that the action has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible location. Don't miss your chance to ride the wave of the data revolution! Every industry is scaling new heights by tapping into the power of data. Sharpen your skills, become a part of the hottest trend in the 21st century.Dive into the future of technology - explore the Complete Machine Learning and Data Science Program by GeeksforGeeks and stay ahead of the curve. Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore. Last Updated : 26 Feb, 2020 Like Article Save Article Previous PUT method - Python requests Next HEAD method - Python requests Share your thoughts in the comments Add Your Comment Please Login to comment... Similar Reads GET and POST Requests in GraphQL API using Python requests HEAD method - Python requests PUT method - Python requests PATCH method - Python requests POST method - Python requests GET method - Python requests GET and POST Requests Using Python How to install requests in Python - For windows, linux, mac Http Request methods - Python requests response.headers - Python requests Complete Tutorials Python API Tutorial: Getting Started with APIs Advanced Python Tutorials Python Automation Tutorial OpenAI Python API - Complete Guide Pandas AI: The Generative AI Python Library Like N NaveenArora Follow Article Tags : Python-requests Python Practice Tags : python Additional Information Vote for difficulty : Easy Normal Medium Hard Expert