我试图让 TOMTOM trafficstats api 正常工作,但没有得到我预期的响应。我正在使用 Postman 生成一个 POST 请求https://{{baseURL}}/traffic/trafficstats/routeanalysis/{{versionNumber}}?key={{apiKey}}
我设置了 versionNumber =1 和 key='my TOMTOM access key'。文档说 baseURL 应该是 'api.tomtom.com' ,但是这样做时我得到了“开发人员不活动”的响应。但是,如果我使用 baseURL='move.tomtom.com',我会得到一个 html 响应。
我正在发送以下机构,试图获取旧金山街道上的历史交通数据:
{
"jobName":"Test job",
"distanceUnit":"MILES",
"routes":[
{
"name":"The Embarcadero",
"start":{
"latitude":37.794672,
"longitude":-122.393938
},
"via":[
{
"latitude":37.783319,
"longitude":-122.388037
}
],
"end":{
"latitude":37.775170,
"longitude":-122.395783
},
"fullTraversal":false,
"zoneId":"UTC",
"probeSource":"ALL"
}
],
"dateRanges":[
{
"name":"First day of November",
"from":"2010-11-01",
"to":"2010-11-01"
}
],
"timeSets":[
{
"name":"Monday morning hour",
"timeGroups":[
{
"times":[
"7:00-8:00"
]
}
]
}
]
}
我的请求标头的“内容类型”设置为“应用程序/json”。
我得到以下 html 响应。我在 html 正文中看不到预期的 json 数据。关于我做错了什么的任何想法?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<title>TomTom Move</title>
<base href="/" />
<link rel="shortcut icon" href="/favicon.png">
<link href="/css/styles.1337aa094afbb0bd778a.css" rel="stylesheet">
<link rel="preload" href="/js/styles.7c8029e7a8f45b1dd768.js" as="script">
<link rel="preload" href="/js/main.2d6a744cf686a687271d.js" as="script">
<link rel="preload" href="/js/vendors~main.0c1946201ec04090e7a7.js" as="script">
<link rel="prefetch" href="/js/styles.7c8029e7a8f45b1dd768.js">
<link rel="prefetch" href="/js/main.2d6a744cf686a687271d.js">
<link rel="prefetch" href="/js/vendors~main.0c1946201ec04090e7a7.js">
</head>
<body>
<div id="app"></div>
<!-- Tealium script -->
<script type="text/javascript">
(function (a, b, c, d) {
a = '//tags.tiqcdn.com/utag/tomtom/move/prod/utag.js';
b = document; c = 'script'; d = b.createElement(c); d.src = a; d.type = 'text/java' + c; d.async = true;
a = b.getElementsByTagName(c)[0]; a.parentNode.insertBefore(d, a);
})();
</script>
<script type="text/javascript" src="/js/styles.7c8029e7a8f45b1dd768.js"></script>
<script type="text/javascript" src="/js/main.2d6a744cf686a687271d.js"></script>
<script type="text/javascript" src="/js/vendors~main.0c1946201ec04090e7a7.js"></script>
</body>
</html>