Add a Content-Type header when sending data
[pithos] / tools / store
index cdf449a..d19dcd6 100755 (executable)
@@ -10,7 +10,7 @@ import json
 import logging
 
 
-DEFAULT_HOST = '127.0.0.1:9000'
+DEFAULT_HOST = 'pithos.dev.grnet.gr'
 DEFAULT_API = 'v1'
 
 
@@ -36,9 +36,10 @@ class Client(object):
         
         kwargs = {}
         kwargs['headers'] = headers or {}
+        kwargs['headers']['Content-Length'] = len(body) if body else 0
         if body:
-            kwargs['headers']['Content-Length'] = len(body)
             kwargs['body'] = body
+            kwargs['headers']['Content-Type'] = 'application/octet-stream'
         
         conn.request(method, full_path, **kwargs)
         resp = conn.getresponse()