Here api 这里是服务器503响应
我已经用python创建了一个应用程序来模拟路线,然后从Here数据扩展API中提取速度限制。该路线长3天,每天8小时。当我为hole route运行应用程序时,我在某个点得到的是503服务器响应,而不是200服务器响应。如果我在收到错误服务器响应的同一个路由上尝试我的应用程序,但在较短的路由(2小时路由)上,它工作正常。它看起来像是服务器中的瓶颈Here api 这里是服务器503响应,here-api,Here Api,我已经用python创建了一个应用程序来模拟路线,然后从Here数据扩展API中提取速度限制。该路线长3天,每天8小时。当我为hole route运行应用程序时,我在某个点得到的是503服务器响应,而不是200服务器响应。如果我在收到错误服务器响应的同一个路由上尝试我的应用程序,但在较短的路由(2小时路由)上,它工作正常。它看起来像是服务器中的瓶颈 if self.country in WEE: url = "http://rme.cit.api.here.com/2/mat
if self.country in WEE:
url = "http://rme.cit.api.here.com/2/matchroute.json?" + \
"app_id=Gxxxxxx" + \
"&app_code=xxxxxx" + \
"&routemode=car&file=" + \
"®ions=WEU&release=LATEST"
else:
url = "http://rme.cit.api.here.com/2/matchroute.json?" + \
"app_id=xxxxx" + \
"&app_code=Qxxxxx" + \
"&routemode=car&file=" + \
"®ions=EEU&release=LATEST"
if self.gps_source == 'gpx':
response = self.connectPost(url, self.tmp_route_data, headers={"Content-type": "application/binary"})
else:
response = self.connectPost(url, self.tmp_route_data, headers={"Content-type": "text/csv"})
if response.status_code != 200:
message = 'Unable to build the route:<br>'
message += 'unexpected response from HERE webservice.'
raise RuntimeError(message)
def connectPost(self, url, data, headers=None):
return self.S.post(url, data=data, headers=headers , proxies = self.proxy_dict)
如果WEE中的self.country:
url=”http://rme.cit.api.here.com/2/matchroute.json?" + \
“应用程序id=Gxxxxxx”+\
“&app_code=xxxxxx”+\
“&routemode=car&file=“+\
“®ions=WEU&release=LATEST”
其他:
url=”http://rme.cit.api.here.com/2/matchroute.json?" + \
“应用程序id=xxxxx”+\
“&app_code=Qxxxxx”+\
“&routemode=car&file=“+\
“®ions=EEU&release=LATEST”
如果self.gps_source=='gpx':
response=self.connectPost(url,self.tmp_路由_数据,头={“内容类型”:“应用程序/二进制文件”})
其他:
response=self.connectPost(url,self.tmp_路由_数据,标题={“内容类型”:“text/csv”})
if response.status_代码!=200:
消息='无法生成路由:
'
message+=“来自此Web服务的意外响应。”
引发运行时错误(消息)
def connectPost(self、url、data、headers=None):
返回self.S.post(url,data=data,headers=headers,proxies=self.proxy\u dict)
客户集成测试(CIT)应用于低容量集成和功能测试。此处不提供CIT环境的SLA
生产环境和CIT环境都不是为支持突然的、未宣布的高负载而设计的。如果您需要进行性能测试,请讨论选项。您可以分享您的API调用以便我们重新创建吗?@Leoptectas我尝试了很多次,发现这是随机的。它有时在比利时发生,有时在意大利发生,坐标不同。我注意到您使用的是测试端点(CIT),而不是生产。能否从URL中删除“.cit”,再试一次并报告?@Leoptect该问题已通过URL中的“.cit”解决,可能存在服务器问题,但现已修复。谢谢你的快速回复。