#condig=utf-8
import requests
import json,gzip
def toGzipFormat(postData):
data=bytes(json.dumps(postData),'utf-8')
ct=gzip.compress(data,)
return ct
postData= {
"ProtocolType": "01003",
"TaskId": "1"
}
requestHeaders = {
'Content-Encoding': 'gzip',
'Content-Type':'x-application/x-gzip'
}
requests.post(url = 'XXXX',data=toGzipFormat(postData),headers=requestHeaders)