aboutsummaryrefslogtreecommitdiff
path: root/scripts/http-client.py
blob: 815270adb3056e9f3b416fb78cadd59d7724ea75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()