Programming-Idioms

History of Idiom 183 > diff from v13 to v14

Edit summary for version 14 :
[Python] Variable name u

Version 13

2020-11-21, 22:22:04

Version 14

2020-11-21, 22:24:20

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
Variables
u
Imports
requests
Imports
import 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
content_type = 'text/plain'
headers = {'Content-Type': content_type}
data = {}

r = requests.put(u, 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/@ProgIdioms/DizzyExaltedTests#main.py
Demo URL
https://repl.it/@ProgIdioms/DizzyExaltedTests#main.py