diff options
author | Rob Austein <sra@hactrn.net> | 2007-08-08 02:01:12 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-08-08 02:01:12 +0000 |
commit | 554dcec5c47524ec4b7f6797ab53955bbcb37561 (patch) | |
tree | 9b2f192a9509139d9fb2b3ce9e46fdcb8862247d /scripts/http-client.py | |
parent | 608df65bfec1259709ff442691de8c60a950ae1c (diff) |
Checkpoint
svn path=/scripts/http-client.py; revision=835
Diffstat (limited to 'scripts/http-client.py')
-rw-r--r-- | scripts/http-client.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/http-client.py b/scripts/http-client.py new file mode 100644 index 00000000..815270ad --- /dev/null +++ b/scripts/http-client.py @@ -0,0 +1,19 @@ +# $Id$ + +import httplib + +http = httplib.HTTPSConnection("localhost", 8080) + +http.connect() +http.request("POST", "/", "This is a test. This is only a test. Had this been real you would now be really confused.\n", {"Content-Type":"application/wombat"}) +response = http.getresponse() + +for h in response.getheaders(): + print "%s: %s" % h +print +if response.status == httplib.OK: + print "OK" +else: + print "Ouch" +print +print response.read() |