Establishing Https connection

Kwpolska kwpolska at
Tue Dec 11 20:45:29 CET 2012

On Tue, Dec 11, 2012 at 7:26 PM,  <nenad.cikic at> wrote:
> Hello,
> Once I get my xml populated I have to send it to web service.
> Should I use httplib?
> I am reading the docs and I have managed to open the connection with
> httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address]]]]]])
> After that i intend to use
> HTTPConnection.request('POST', url[, body[, headers]])
> During opening it asks me for the password. I see that the urllib class has prompt_user_passwd() that can be overriden for the password supply, so that no console action is necessary, but with httplib how is done?
> My questions are:
> -am I using the right class?
> -i intend to store certificate and private key in database, but how can I use them without saving back to file?
> I have already developed applications for http/https but not in python, so I need some hint to point me in the right direction.
> Thanks
> Nenad
> --

I, for one, suggest <> for your sanity.  I
guess it would be something along the lines of:

import requests
xml = """<?xml version="1.0" encoding="UTF-8" ?> ..."""
files = {'file-field-as-requested-by-the-service': xml}, files=files, auth=HTTPDigestAuth('user', 'pass'))

and other stuff from there.

Httplib may not be wrong, but I’m doing this for your sanity.
Kwpolska <>
stop html mail      | always bottom-post |

More information about the Python-list mailing list