i am using the below code to login and retrieve data from an api endpoint but seems the response see encoded and i am not able to read the content.
(我正在使用以下代码从api端点登录和检索数据,但似乎响应已编码,因此我无法读取内容。)
i am using request requestes-0.0.1 (我正在使用请求requestes-0.0.1)
import requests
import json
import os
http_proxy = "http://192.168.10.20:8888"
https_proxy = "https://192.168.10.20:8888"
proxyDict = {
"http" : http_proxy,
"https" : https_proxy,
}
session = requests.Session()
payloadopt = 'user_id=tom&password=xxxxx'
s = session.post('https://login.milock.com/api/login',data=payloadopt, proxies=proxyDict, verify=False, headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0', 'Accept':'application/json, text/plain, */*', 'Accept-Language':'en-US,en;q=0.5', 'Accept-Encoding':'gzip, deflate, br', 'Content-Type':'application/x-www-form-urlencoded'}, stream=True)
response when i print the same on console
(当我在控制台上打印相同的响应)
??7?E`??YD??k???q??f,??G?(U?Uv?4???w&??!Ψ????E5Q?_??{?F??<.????4??> p{?k9???9??
Can someone tell me how can decode and read the data from the response
(有人可以告诉我如何解码和读取响应中的数据)
ask by mikeraj2019 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…