import urllib, urllib2, json CHUNK_SIZE = 1024 url = "https://httpbin.org/post" data = "*" * (1024 * 64 + 0) req = urllib2.Request(url, data) req.add_header("Content-Type", "application/text") response = urllib2.urlopen(req) res_data = [] while True: chunk = response.read(CHUNK_SIZE) res_data.append(chunk) if len(chunk) != CHUNK_SIZE: break res_data = "".join(res_data) response.close() res = json.loads(res_data) print len(res["data"])