An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
August 26, 2021 09:49 pm GMT
Original Link: https://dev.to/ayabouchiha/sending-delete-requests-in-python-4057
Sending DELETE Requests In Python
What's a delete request
DELETE: is a request used to delete a specific resource in a server.
Sending a DELETE request in python
import requestsimport jsonurl = 'https://jsonplaceholder.typicode.com/posts/1'headers = {'Content-Type': 'application/json; charset=UTF-8'}response = requests.delete(url, headers=headers)print(response.status_code) # 200print(response.ok) # Trueprint(type(response.text)) # <class 'str'>print(response.url) # https://jsonplaceholder.typicode.com/posts/1print(response.headers['Content-Type']) # application/json; charset=utf-8print(response.encoding) # utf-8
Have a good day
Original Link: https://dev.to/ayabouchiha/sending-delete-requests-in-python-4057
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To