404 HTML as responseText
Posted: Thu Nov 14, 2019 2:32 pm
I want to make a request for a tour, but I get in the answer under the item responseText no JSON but an HTML page with the error code 404 and my page remain blank.
Everything around PTV Developer & more
https://xserver-forum.ptvlogistics.com/
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>Xroute Demo</title>
<script src="https://xserver2-europe-test.cloud.ptvgroup.com/services/xroute-client.js"></script>
</head>
<body>
<div id="map">
</div>
<script>
let token = '<your token>';
let xroute = new XRouteClient();
xroute.setCredentials('xtok', token);
let A = {
"$type": "OffRoadWaypoint",
"location": {
"offRoadCoordinate": {
"x": 6.1256572,
"y": 49.5983745
}
}
};
let B = {
"$type": "OnRoadWaypoint",
"location": {
"coordinate": {
"x": 6.1256572,
"y": 49.4816576
}
}
};
xroute.calculateRoute({
"waypoints": [A, B],
"storedProfile": "car",
"resultFields": {
"eventTypes": [
"MANEUVER_EVENT"
],
"guidedNavigationRoute": true,
"polyline": true
},
}, routingCompleted);
function routingCompleted(route, exception) {
console.log(route.distance + 'm in ' + route.travelTime + 's');
console.log(route);
}
</script>
</body>
</html>