How do i send xml file to http request in python and what are the packages that need to be installed in ubuntu
Question:
How do i send xml file to http request(to web url) in python 2.7 or 3.3 or 3.4 and what are the packages that need to be installed in ubuntu..
Answers:
import requests url = “192.168.6.x:8089/test/request?”; files =””” “”” r = requests.post(url, str(files)) print (r.text) print(r.elapsed)
this worked for me:
with open(f"/tmp/{filename}") as xml:
files = {'file': xml}
response = requests.post(url=complete_url, verify=CA_CERT, cert=(TLS_CERT, TLS_KEY), files=files, timeout=600)
response.raise_for_status()
How do i send xml file to http request(to web url) in python 2.7 or 3.3 or 3.4 and what are the packages that need to be installed in ubuntu..
import requests url = “192.168.6.x:8089/test/request?”; files =””” “”” r = requests.post(url, str(files)) print (r.text) print(r.elapsed)
this worked for me:
with open(f"/tmp/{filename}") as xml:
files = {'file': xml}
response = requests.post(url=complete_url, verify=CA_CERT, cert=(TLS_CERT, TLS_KEY), files=files, timeout=600)
response.raise_for_status()