【问题标题】:The Batch Geocoder API returns only failed status批量地理编码器 API 仅返回失败状态
【发布时间】:2018-12-21 09:43:37
【问题描述】:

我遇到了 Here Batch Geocoder Api 的问题。

我尝试了不同的输入数据和输入参数,但到目前为止没有成功。

我发送一个带有动作运行的请求,例如:

http://batch.geocoder.cit.api.here.com/6.2/jobs?action=run&app_code={app_code_value}&app_id={app_id_valeu}&outdelim=|&outcols=displayLatitude,displayLongitude,locationLabel&outputcombined=false&indelim=|

请求数据为:

recId|searchText|country
0001|Invalidenstraße 116 10115 Berlin|DEU
0002|Am Kronberger Hang 8 65824 Schwalbach|DEU
0003|425 W Randolph St Chicago IL 60606|USA
0004|One Main Street Cambridge MA 02142|USA
0005|200 S Mathilda Ave Sunnyvale CA 94086|USA

请求标头: 内容类型:text/plain

响应状态为“已接受”,这很好,但在我检查状态后

https://batch.geocoder.api.here.com/6.2/jobs/{id}/?action=status&app_id={app_id_value}&app_code={app_code_Value}

返回状态总是失败。

【问题讨论】:

  • 您需要为大括号内的项目的 URL 添加实际值。 {id} {app_id_value} {app_code_Value}
  • 在发布问题之前,我已经删除了实际值并将其替换为 {id} {app_id_value} {app_code_Value}。
  • 如果您将 URL 手动放入浏览器中是否有效?我想确保 id 有效。
  • 第一个请求是 post 但第二个状态是 get 请求。我直接在浏览器中测试过,用javascript和c#,但结果是一样的。
  • <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:SearchBatch xmlns:ns2="http://www.navteq.com/lbsp/Search-Batch/1"> <Response> <MetaInfo> <RequestId>uLJm72DwJTwFv3OfDL0A82AZw9ySEtwM</RequestId> </MetaInfo> <Status>failed</Status> <TotalCount>0</TotalCount> <ValidCount>0</ValidCount> <InvalidCount>0</InvalidCount> <ProcessedCount>0</ProcessedCount> <PendingCount>0</PendingCount> <SuccessCount>0</SuccessCount> <ErrorCount>0</ErrorCount> </Response> </ns2:SearchBatch>

标签: c# here-api geocoder


【解决方案1】:

如果您对 'indelim' 和 'outdelim' 中的管道符号进行 url 编码,例如“indelim=%7C”?

另见https://developer.here.com/documentation/batch-geocoder/topics/request-encoding.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-13
    相关资源
    最近更新 更多