#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)

相关文章:

  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2021-09-26
猜你喜欢
  • 2021-12-04
  • 2021-10-31
  • 2022-12-23
  • 2021-10-05
相关资源
相似解决方案