import requests
import jsonurl = 'https://fanyi.baidu.com/sug'headers = {'User-Agent': '','Cookie': ''
}data = {'kw': 'hello'
}response = requests.post(url, data, headers=headers)content = response.textobj = json.loads(content.encode('utf-8'))
print(obj)
总结:
- post请求不需要编解码
- post请求的参数是data
- 不需要请求对象的定制