I am trying to POST xml to a site using python. I have to include a certificate but am unsure of how to do this. Is it enough to specify the file path of the certificate locally on my computer?
Can anybody show my an example of how to include the certificate in the request?
import http.client, urllib.parse
xml="""<?xml version="1.0" encoding="UTF-8"?>
<home>
<bathroom>1</bathroom>
<kitchen>1</kitchen>
<street>515</street>
</home>);"""
headers = {"username": "password"}
conn = http.client.HTTPSConnection("someurl.com", cert_file="D:\Users\Username\certificate.p12")
conn.request("POST", "/to/this/place", xml, headers)
response = conn.getresponse()
print(response.status, response.reason)
data = response.read()
print(data)
conn.close()