Cannot get POST to work

tedpottel at gmail.com tedpottel at gmail.com
Tue Sep 29 12:24:25 EDT 2009


Hi,
I'm trying to post data to a short test script in php I wrote.
The python code to do the post is
import httplib

#server address
conn = httplib.HTTPConnection("localhost")

#file location
conn.request("POST", "/programming/bots/test.php","&ted=fred")
r1 = conn.getresponse()
print r1.status, r1.reason
data1 = r1.read()
print data1
conn.close()
print "new ok"

The PHP script is
print"hello <br>";
print $_POST["ted"];

Ted post



More information about the Python-list mailing list