Hello all!
I am new to open route service (and maps stuff in general) and I am trying to make a query to grab the distances matrix.
I am using axios and the request data looks like this:
Starting Request {
url: 'https://api.openrouteservice.org/v2/matrix/foot-walking?api_key=MYKEY',
method: 'post',
data: '{"metrics":["distance"],"units":"m","locations":[[9.70093,48.477473],[9.207916,49.153868],[37.573242,55.801281],[115.663757,38.106467]]}',
headers: {
common: { Accept: 'application/json, text/plain, */*' },
delete: {},
get: {},
head: {},
post: { 'Content-Type': 'application/json;charset=UTF-8' },
put: { 'Content-Type': 'application/x-www-form-urlencoded' },
patch: { 'Content-Type': 'application/x-www-form-urlencoded' },
'Content-Type': 'application/json;charset=UTF-8',
'access-control-allow-origin': '*'
},
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus]
}
However, this does not return at all anything, not even an error. If I do the request with POSTMAN it works ok. Therefore, it seems there is something axios adds into the header that upsets the back-end API. When I have seen this are in scenearios where you have an async function and you do not “await” but I use await for request, so no clue what is going on.
Does anyone see what could that be?
Thank you in advance and kind regards.