urllib POST question

Guido Goldstein guido-clpy at a-nugget.de
Sat Jun 22 15:00:22 CEST 2002


Hi!

On 21 Jun 2002 10:00:44 -0700
  rdacker at pacbell.net (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?
> > 
> > I'm a big fan of Ethereal...
> > "Sniffing the glue that holds the internet together!"
> > 
> > http://www.ethereal.com/
> 
> i am looking into it. seems overkill for wanting to see a few bytes
> that python is generating.
> No way within python to see what urllib intends to send out for the
> POST?

If you're on *NIX (like GNU/Linux) there might be a program call
netcat (or nc on some machines).

>From the man-page:
-- cut --
NAME
       nc - TCP/IP swiss army knife

SYNOPSIS
       nc [-options] hostname port[s] [ports] ...
       nc -l -p port [-options] [hostname] [port]

DESCRIPTION
       netcat  is a simple unix utility which reads and writes data across network connec­
       tions, using TCP or UDP protocol. It is designed to be a reliable  "back-end"  tool
       that  can  be used directly or easily driven by other programs and scripts.  At the
       same time, it is a feature-rich network debugging and exploration  tool,  since  it
       can create almost any kind of connection you would need and has several interesting
       built-in capabilities.  Netcat, or "nc" as the actual program is named, should have
       been supplied long ago as another one of those cryptic but standard Unix tools.
[...]
-- cut --

When you start it in listening mode it will sit and wait for
connections. So when you connect with your program, nc will show what
it has received.

BTW: nc is a *must* on all machines <0.5 wink>

HIH
  Guido -- no, not this one...



More information about the Python-list mailing list