Python Request POST

https://www.w3schools.com/python/ref_requests_post.asp

import requests

url = 'https://www.w3schools.com/python/demopage.php'
myobj = myjson = {'somekey': 'somevalue'}

x = requests.post(url)
print x.text
print x.apparent_encoding
print x.close()
print x.content
print x.cookies
print x.elapsed
print x.encoding
print x.headers
print x.history
print x.is_permanent_redirect
print x.is_redirect
print x.iter_content()
print x.iter_lines()
print x.json()
print x.links
print x.next
print x.ok
print x.raise_for_status()
print x.reason
print x.request
print x.status_code
print x.text
print x.url

x = requests.post(url, data = myobj)
print x.text

x = requests.post(url, json = myjson)
print x.text

myfiles = {'file': open('myfirstreact.png' ,'rb')}
x = requests.post(url, files = myfiles)
print x.text

#first, make a request without setting the 'allow_redirects' parameter to False:
x = requests.post(url, data = myobj)
print(x.text)
print("----------------")
#then, make a request with the 'allow_redirects' parameter set to False:
x = requests.post(url, data = myobj, allow_redirects=False)
print(x.text)

x = requests.post(url, data = myobj, auth = ('user', 'pass'))
print(x.status_code)

x = requests.post(url, data = myobj, cert='folder/myclient.cert')
print(x.status_code)

x = requests.post(url, data = myobj, cookies = {"favcolor": "Red"})
print(x.text)

x = requests.post(url, data = myobj, headers = {"HTTP_HOST": "MyVeryOwnHost"})
print(x.text)

x = requests.post(url, data = myobj, proxies = { "https" : "https://1.1.0.1:80"})
#'demopage.php' will print the ip address of the proxy instead of your ip:
print(x.text)

x = requests.post(url, data = myobj, stream=True)
print(x.status_code)

x = requests.post(url, data = myobj, timeout=0.001)
print(x.text)

x = requests.post(url, data = myobj, verify='folder/tlscertificate')
print(x.status_code)

x = requests.post(url, data = myobj, verify=False)
print(x.status_code)