From: chadm at sgi.com (Chad McDaniel)
Date: 09 Apr 1999 10:29:53 -0700
Subject: POST request
References: <7eilen$g9o$1@nnrp1.dejanews.com>
Message-ID: <x1jpv5d4s8e.fsf@unhinged.engr.sgi.com>
Content-Length: 1044
X-UID: 1638                                                  

gscot at my-dejanews.com writes:

> To All: 	I would like to write a short program that would play a game
> found on the Internet. I cannot find any documentation on how to make a POST
> request. It is a stock market game. You fill out a form with the symbol and
> number of share you want to buy or sell. The form uses the POST method to
> send the data. Since I cannot just put this information in the url I am not
> sure how to write a program to automate this procese. Is there any way to do
> that with Python. Thank you for your help.     Gary
> 

If you are asking how you can make a POST request to a HTTP web server
using python as the client then yes, you can do this with urllib which
should be part of your python installation. urllib.urlopen() normally
uses GET, but if you supply a second data argument it will send that
data along as the body of a POST. With python 1.5.2 there is also a
very hand urllib.urlencode() function to transform a python
dictionary into something suitable for the body of a POST request.

-- 
-chad




