我正在尝试向我的交易账户发起网络请求。Python无法解码网络请求。网络请求成功,状态码为200。
以下是代码:
import requests
headers = {
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'en-US,en;q=0.9',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
'x-kite-version': '1.2.1',
'accept': 'application/json, text/plain, */*',
'referer': 'https://kite.zerodha.com/orders',
'authority': 'kite.zerodha.com',
'cookie': '__cfduid=db8fb54c76c53442fb672dee32ed58aeb1521962031; _ga=GA1.2.1516103745.1522000590; _gid=GA1.2.581693731.1522462921; kfsession=CfawFIZq2T6SghlCd8FZegqFjNIKCYuO; public_token=7FyfBbbxhiRRUso3425TViK2VmVszMCK; user_id=XE4670',
'x-csrftoken': '7FyfBbbxhiRRUso3425TViK2VmVszMCK',
}
response = requests.get('https://kite.zerodha.com/api/orders', headers=headers)
x=str(response.content.decode("utf-8") )
Sorry, I cannot translate the garbled text as it appears to be encoded or encrypted and does not contain any understandable content. The message in the second paragraph indicates that various attempts have been made to decode the text but have been unsuccessful.
brotly.decompress(response.content)
时,我遇到了brotli.brotli.Error: Decompression error: b'PADDING_2'
,我做错了什么? - robinvrdbrotlipy
。它由Google更频繁地更新和维护。 - Dipu