Programming-Idioms

History of Idiom 183 > diff from v11 to v12

Edit summary for version 12 :
[Python] Repl.it now requires code ownership

Version 11

2019-09-29, 08:46:43

Version 12

2020-11-21, 21:52:31

Idiom #183 Make HTTP PUT request

Make a HTTP request with method PUT to URL u

Idiom #183 Make HTTP PUT request

Make a HTTP request with method PUT to URL u

Variables
u
Imports
requests
Imports
requests
Code
import requests

content_type = 'text/plain'
headers = {'Content-Type': content_type}
data = {}

r = requests.put(url, headers=headers, data=data)
status_code, content = r.status_code, r.content
Code
import requests

content_type = 'text/plain'
headers = {'Content-Type': content_type}
data = {}

r = requests.put(url, headers=headers, data=data)
status_code, content = r.status_code, r.content
Doc URL
https://pypi.org/project/requests/
Doc URL
https://pypi.org/project/requests/
Origin
https://stackoverflow.com/questions/111945/is-there-any-way-to-do-http-put-in-python
Origin
https://stackoverflow.com/questions/111945/is-there-any-way-to-do-http-put-in-python
Demo URL
https://repl.it/repls/DizzyExaltedTests
Demo URL
https://repl.it/@ProgIdioms/DizzyExaltedTests#main.py