webservice httplib HTTPSConnection host key_file test1 pem cert_file C

1
2
3
4
5
6
7
8
webservice = httplib.HTTPSConnection(host,key_file='test1.pem',cert_file='CA.crt')
webservice.debuglevel = 1
webservice.putrequest("POST", "/asp/XMLInvoiceCert.asp")
webservice.putheader("Content-length", "%d" % len(SM_TEMPLATE))
webservice.putheader("Content-Type", "application/x-www-form-urlencoded")
webservice.endheaders()
webservice.send(SM_TEMPLATE)
response = webservice.getresponse()