timezone - Bing 地图:时区 REST API 不起作用
问题描述
我尝试使用 Time Zone REST API,无论我使用什么参数和检查什么坐标,它都不会返回预期的数据,并且在所有情况下我都会得到以下结果:
回复:
{
"authenticationResultCode":"ValidCredentials",
"brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
"copyright":"Copyright © 2021 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets":[
{
"estimatedTotal":1,
"resources":[
{
"__type":"RESTTimeZone:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
"timeZoneAtLocation":[
]
}
]
}
],
"statusCode":200,
"statusDescription":"OK",
"traceId":"55590586fc5b4183865c58af24845970|DU00000D6E|0.0.0.1|Ref A: 3D98A80E080A45289BEC315D7EE37BDA Ref B: DB3EDGE1522 Ref C: 2021-04-23T14:04:29Z"
}
这不是事务使用限制问题,我最近才注册了该服务。我尝试使用其他 REST API 服务(例如 Elevations API),它确实有效。
请开导我的眼睛并向我解释什么是错的。
解决方案
看起来您的请求网址是错误的,只需从您的查询中删除“point =”即可。 https://dev.virtualearth.net/REST/v1/TimeZone/40.7844503,-73.528732?datetime=2021-04-23T00:00:00Z&includeDstRules=true&key=API_KEY
{
"authenticationResultCode": "ValidCredentials",
"brandLogoUri": "http://dev.virtualearth.net/Branding/logo_powered_by.png",
"copyright": "Copyright © 2021 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets": [
{
"estimatedTotal": 1,
"resources": [
{
"__type": "RESTTimeZone:http://schemas.microsoft.com/search/local/ws/rest/v1",
"timeZone": {
"genericName": "Eastern Standard Time",
"abbreviation": "EST",
"ianaTimeZoneId": "America/New_York",
"windowsTimeZoneId": "Eastern Standard Time",
"utcOffset": "-5:00",
"convertedTime": {
"localTime": "2021-04-22T20:00:00",
"utcOffsetWithDst": "-4:00",
"timeZoneDisplayName": "Eastern Daylight Time",
"timeZoneDisplayAbbr": "EDT"
},
"dstRule": {
"dstStartMonth": "Mar",
"dstStartDateRule": "Sun>=8",
"dstStartTime": "2:00",
"dstAdjust1": "1:00",
"dstEndMonth": "Nov",
"dstEndDateRule": "Sun>=1",
"dstEndTime": "2:00",
"dstAdjust2": "0"
}
}
}
]
}
],
"statusCode": 200,
"statusDescription": "OK",
"traceId": "2fd8f869974046f182ac948253e83de9|HK00000C07|0.0.0.1"
}
您可以在https://docs.microsoft.com/en-us/bingmaps/rest-services/timezone/find-time-zone中找到更多详细信息和示例
推荐阅读
- httprequest - Mulesoft 中的 SO_KEEPALIVE 问题
- python - Web-Scrape ,寻找更好的方法来获取类或标记 xpath 和动态网页
- swift - CoreBluetooth 和 Omron Evolv 血压计
- c - 可变大小的对象可能没有被初始化(但有一个扭曲)C
- react-native - Twilio Conversations - 获取 React Native 上超出的最大调用堆栈大小
- c# - Unity URP 纹理未正确显示
- bluetooth - 蓝牙准备好 systemd 后无法启动任务
- angular - 在 Spring-mvc 项目文件夹中放置 angular8 构建文件的位置(+ 用于 NG 的正确 AppConfig.java?)
- python - folium MarkerCluster 如何在 python 中为颜色编写 icon_create_function
- reactjs - 如何使 webpack / react 和电子在安全的上下文中工作?