HTTP Post ?

Peter Hansen peter at engcorp.com
Tue Jan 28 09:10:25 EST 2003


Shagshag13 wrote:
> 
> i'm trying to simulate a http post with python. i've found the 
> following in another post and it seems to work:
> 
> import urllib
> params = {'param1': 'data1', 'param2': 'data2'}
> cparams = urllib.urlencode(params)
> fh = urllib.urlopen('http://localhost/cgi-bin/test.py', cparams)
> 
> but i would like to understand how http post headers are built and 
> how it's actually work, please do any of you have  pointers/links
> to relevant information on the subjet ?

What searches have you done with Google?  It's your friend... try
something based on the name of the standard involved in your problem,
in this case "HTTP" and maybe another word related to the specific
case involved, such as "POST".

Another good option is to read the source.  If you look in your
Python directory, under "lib", you can find the file urllib.py 
which is certainly the best place to go to "understand how HTTP
POST headers are built"...

-Peter




More information about the Python-list mailing list