【发布时间】:2019-06-21 14:48:51
【问题描述】:
我想用这些数据进行 python 查询,但我无法转换 python 查询可解释的“data-urlencode”。
这是我的 curl 请求:
curl \
--compressed \
-H 'Accept-Encoding:gzip' \
-H 'Accept-Language:fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7' \
--get '**myurl**' \
--data-urlencode 'app_code=xxxxxx' \
--data-urlencode 'app_id=xxxxxx'
这是我实际的 python 请求:
import requests
headers = {
'Accept-Encoding': 'gzip',
'Accept-Language': 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',
}
data = {
'app_code': 'xxxxx',
'app_id': 'xxxxx'
}
response = requests.post('https://places.cit.api.here.com/places/v1/autosuggest', headers=headers, data=data)
我无法对数据进行编码以获取 json。 谢谢
【问题讨论】:
标签: python python-3.x curl python-requests