Am Montag, den 11.07.2005, 06:29 -0700 schrieb michaelparkin@gmail.com:
> Hi,
>=20
> Sorry to post what might seem like a trivial problem here, but its
> driving me mad!
>=20
> I have a simple https client that uses httplib to post data to a web
> server.
>=20
> When I post over http & https using curl the data is recieved by the
> web server with no problems.
Just a curious guess: Are you behind a proxy? If so, it's a known and
never fixed bug from Python 1.5 times ;)
You might also try to use PyCurl.
Andreas
>=20
> When I post using my python client the headers get there, but the body
> of the message does not.
>=20
> My code is pretty standard and has the format:
>=20
>=20
> httplib.HTTPSConnection.debuglevel =3D 1
> connection =3D httplib.HTTPSConnection(host_name, key_file =3D key,
> cert_file =3D cert)
> connection.putrequest("POST", path)
> connection.putheader("Content-Length", str(len(body)))
>=20
> ...(some more headers)...
>=20
> connection.endheaders()
> connection.send(body)
>=20
> response =3D connection.getresponse()
> connection.close()
>=20
> (some code has been removed for clarity)..
>=20
> I can see in the debug messages the body getting sent, but nothing
> arrives at
> the server...
>=20
> I think I would understand whats going on better if I knew how Python
> uses the
> underlying socket - does it
>=20
> a) open the socket, send the header & body together or
> b) send the header, wait, then send the body?
>=20
> I think the answer to this question solve my problem - can anyone help?
>=20
> Thanks.
>=20
> p.s. I'm using Python 2.3.3 [GCC 3.3.3 (SuseLinx)]
>=20
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQBC1Yh5HJdudm4KnO0RAn32AKDhuPqPLTUh8Cz3vRNtcMRZDfHSUgCeMzfU
zfNiyFIHDcosx5aNLAWLuNM=
=aJGI
-----END PGP SIGNATURE-----
[plaintext signature.asc.1121290361.632518014]
Received on Thu Sep 29 16:56:27 2005