urllib POST question

rdack rdacker at pacbell.net
Sat Jun 22 12:30:36 EDT 2002


Peter Hansen <peter at engcorp.com> wrote in message news:<3D13D62B.D7AE6554 at engcorp.com>...
> rdack wrote:
> > 
> > Ben Beuchler <insyte-clp at emt-p.org> wrote in message news:<slrnah4dbq.r77.insyte-clp at petra.bitstream.net>...
> > > In article <644f6688.0206200930.48110837 at posting.google.com>, rdack wrote:
> > > > i am doing a POST to a server using urllib and it works.
> > > > is there some way i can see exactly what is being posted?
> > > > a way to get the post object out of urllib - the exact lines it is sending?
> Howzabout this?
> 
> >>> import httplib
> >>> httplib.HTTPConnection.debuglevel = 1
> >>> import urllib
> >>> page = urllib.urlopen('http://web.engcorp.com:8080/?test=1').read()
> connect: (web.engcorp.com, 8080)
> send: 'GET /?test=1 HTTP/1.0\r\n'
> send: 'Host: web.engcorp.com:8080\r\n'
> send: 'User-agent: Python-urllib/1.15\r\n'
> send: '\r\n'
> reply: 'HTTP/1.0 200 OK\r\n'
> header: Server: Zope/(Zope 2.5.1 (binary release, python 2.1, linux2-x86), pytho
> n 2.1.3, linux2) ZServer/1.1b1
> header: Date: Sat, 22 Jun 2002 01:25:46 GMT
> header: Connection: close
> header: Content-Type: text/html
> header: Etag:
> header: Content-Length: 174
> >>> len(page)
> 174
> 
> -python-rocks-ly yr's,
>  Peter

perfect! thanks. although i was able to install ethereal and see the
packet-it was the 100 megabyte solution.
this was the zero byte solution.
of course, now i have the roll royce of packet sniffers.
anyway - you are right - python-rocks - when you know which button to
push. :-).



More information about the Python-list mailing list