4
by Aaron Bentley
Initial test. |
1 |
from httplib import HTTPConnection |
2 |
||
3 |
def put_message(archive_name, file_obj): |
|
4 |
connection = HTTPConnection('localhost', 8435) |
|
5 |
connection.request('POST', 'foo', file_obj.read()) |
|
6 |
response = connection.getresponse() |
|
7 |
data = response.read() |
|
5
by Aaron Bentley
Actual fake service working. |
8 |
if response.status == 400: |
9 |
raise Exception('wtf') |
|
10 |
elif response.status == 200: |
|
11 |
return
|
|
12 |
else: |
|
13 |
raise Exception('!!') |