I use the request-module of python 2.7 to post a bigger chunk of data to a service I can\'t change. Since the data is mostly text, it is large but would compress quite well. The
# Works if backend supports gzip additional_headers['content-encoding'] = 'gzip' request_body = zlib.compress(json.dumps(post_data)) r = requests.post('http://post.example.url', data=request_body, headers=additional_headers)