python - Python 请求 POST - 408 超时
问题描述
我正在尝试使用 HERE.com 上的 Batch API 在 Python 中对地址进行地理编码(https://developer.here.com/api-explorer/rest/batch_geocoding/batch-geocode-addresses)
url = 'https://batch.geocoder.api.here.com/6.2/jobs?app_id={APP_ID}&app_code={APP_CODE}&indelim=%7C&outdelim=%7C&action=run&outcols=displayLatitude%2CdisplayLongitude%2ClocationLabel&outputcombined=true'.format(APP_ID=appId, APP_CODE=appCode)
headers = {'content-type': 'text/plain', 'Accept-Charset': 'UTF-8'}
payload = open('payload_sm.txt')
r = requests.post(url, data=payload, headers=headers)
这给了我:
408 请求超时
请求超时
服务器超时等待来自客户端的 HTTP 请求。
我不确定 txt 文件的格式是否正确。从视觉上看,它看起来像他们的样本输入。如果那是问题,我想我会收到“ 400 Bad Request ”。
解决方案
推荐阅读
- c# - selenium c#:如何在测试方法中跳过登录
- serial-port - CP2102 usb-ttl 在我关闭 minicom 之前不会传输数据
- python - 在 Python 中的类中定义多个列表变量的最佳方法
- javascript - index.js:28 未捕获的类型错误:无法读取 null 的属性“addEventListener”(在 toggleActiveOnClick 和 Array.forEach 中)
- r - lapply 带有可选函数参数和可选向量参数
- java - 从 Java 代码创建 AVD 设备。图书馆或其他解决方案
- c# - ASP.Net core Razor Class Libray 解析视图顺序
- sql - 对分数求和并按数字排列
- sql - SQL - 由“,”附近的不正确语法和变量声明引起的错误
- html - 如何仅将不透明度设置为背景