[PATCH 2/4] Request has headers and body. Allow POST method

Richard Ipsum richard.ipsum at codethink.co.uk
Tue Apr 8 18:59:41 BST 2014


---
 distbuild-helper |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/distbuild-helper b/distbuild-helper
index 7399fb5..ab1bc83 100755
--- a/distbuild-helper
+++ b/distbuild-helper
@@ -155,7 +155,9 @@ class HelperMachine(distbuild.StateMachine):
 
         url = msg['url']
         method = msg['method']
-        assert method in ('HEAD', 'GET')
+        headers = msg['headers']
+        body = msg['body']
+        assert method in ('HEAD', 'GET', 'POST')
 
         logging.debug('JsonMachine: http request: %s %s' % (method, url))
 
@@ -166,7 +168,7 @@ class HelperMachine(distbuild.StateMachine):
 
         try:
             conn = httplib.HTTPConnection(netloc)
-            conn.request(method, path)
+            conn.request(method, path, body, headers)
         except (socket.error, httplib.HTTPException), e:
             status = 418 # teapot
             data = str(e)
-- 
1.7.10.4




More information about the baserock-dev mailing list