Internet Robot

David Steuber trashcan at david-steuber.com
Thu Apr 8 19:21:07 EDT 1999


gscot at my-dejanews.com writes:

-> To All, 	I would like to write a Python robot to play an Internet
-> game. I do not know how to make a POST request. Thanks to anyone in advance
-> that can point me in the right direction.  Gary

There are two ways to post data.  I remember one way, but the other is 
a little trickier.  The simple way is to send up a URL encoded string
as the body of the request.  The other is to send a multi-part mime
document.  I suggest you go with the former if possible.  A post would 
look something like this:

POST /URI HTTP/1.0
Content-Length: octets
Content-Type: <nuts!  I forget this one!  See the CGI spec>

URL+Encoded+Data+as+name+value+pairs


A good thing to do would be to capture the output of an HTTP client
posting form data.  Also see RFC-1945 and RFC-2068.

-- 
David Steuber
http://www.david-steuber.com

s/trashcan/david/ to reply by mail
If you don't, I won't see it.

A LISP programmer knows the value of everything, but the cost of
nothing.




More information about the Python-list mailing list