为了账号安全,请及时绑定邮箱和手机立即绑定

Python 请求发布错误..无法解码

Python 请求发布错误..无法解码

PIPIONE 2022-08-02 17:05:14
api_url = "https://en.coinjinja.com/api/events/search"headers = {'origin': 'https://en.coinjinja.com',        'accept-encoding': 'gzip, deflate, br',        'accept-language': 'ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7',        'authority': 'en.coinjinja.com',        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36',        'content-type': 'application/json',        'content-length': '126',        'accept': '*/*',        'referer': 'https://en.coinjinja.com/events/time/next_week/tags/hardfork+airdrop+burn+exchange+partnership'    }    data = {"start": "2020-02-17","end":"2020-02-24","symbol":"","types":["hardfork","airdrop","burn","exchange","partnership"]}    api_request = requests.post(api_url, headers=headers, data=json.dumps(data))    print(api_request.headers)    print(api_request.encoding)    print(api_request.content.decode('utf-8','ignore'))
查看完整描述

1 回答

?
慕雪6442864

TA贡献1812条经验 获得超5个赞

您需要安装软件包才能使用“内容编码”:“br”。它是无法解码Python Web请求的副本brotli



查看完整回答
反对 回复 2022-08-02
  • 1 回答
  • 0 关注
  • 109 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信