Python requests delete with body
I'm using the requests package for interacting with the toggl.com API. Show I can perform GET and POST requests:
but i cant seem to find a way to perform a DELETE request. Is this possible?
tkone 21.2k5 gold badges51 silver badges77 bronze badges asked Apr 17, 2012 at 12:57
Use requests.delete instead of
answered Apr 17, 2012 at 13:02
Elvis D'SouzaElvis D'Souza 2,1931 gold badge22 silver badges30 bronze badges 1
answered Sep 13, 2018 at 7:38
Not the answer you're looking for? Browse other questions tagged python django httprequest or ask your own question.❮ Requests Module ExampleMake a DELETE request to a web page, and return the response text: import requests x = requests.delete('https://w3schools.com/python/demopage.php') print(x.text) Run Example » Definition and UsageThe DELETE requests are made for deleting the specified resource (file, record etc). Syntaxrequests.delete(url, args) args means zero or more of the named arguments in the parameter table below. Example: requests.delete(url, timeout=2.50) Parameter Values
Return ValueThe delete() method returns a requests.Response object. ❮ Requests Module |