HERE RESTful API - POST - Fleet Telematics
Afficher commentaires plus anciens
Hi, How can I send this request in matlab?
/////
curl --location --request POST 'https://fleet.cit.api.here.com/2/calculateroute.json?routeMatch=1&mode=car&app_id=ABCDEFGHIJK&app_code=ABCDEFGHIJK&attributes=ROAD_GEOM_FCn(*),%0ASPEED_LIMITS_FCn(*)' \
--header 'Content-Type: text/plain' \
--data-raw '<?xml version="1.0" encoding="UTF-8" standalone="no"?><gpx version="1.0" creator="ITN Converter 1.94M (http://www.benichou-software.com)" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xmlns:topografix="http://www.topografix.com/GPX/Private/TopoGrafix/0/2" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.topografix.com/GPX/Private/TopoGrafix/0/2 http://www.topografix.com/GPX/Private/TopoGrafix/0/2/topografix.xsd"><time>2020-06-22T11:22:23Z</time><bounds minlat="49.274710" minlon="9.223330" maxlat="49.288730" maxlon="9.242580"/><rte><name>Route_from_Peter</name><rtept lat="49.274710" lon="9.223330"/><rtept lat="49.274740" lon="9.223380"/><rtept lat="49.274840" lon="9.223540"/><rtept lat="49.275030" lon="9.223830"/><rtept lat="49.275160" lon="9.224100"/><rtept lat="49.275260" lon="9.224290"/>...........................<rtept lat="49.288230" lon="9.241680"/><rtept lat="49.288280" lon="9.241760"/><rtept lat="49.288340" lon="9.241850"/><rtept lat="49.288390" lon="9.241920"/><rtept lat="49.288440" lon="9.241990"/><rtept lat="49.288560" lon="9.242200"/><rtept lat="49.288730" lon="9.242580"/></rte></gpx>'
/////
I have used this code,
/////
url = 'https://fleet.cit.api.here.com/2/calculateroute.json?routeMatch=1&mode=car&app_id=ABCDEFGHIJK&app_code=ABCDEFGHIJK &attributes=ROAD_GEOM_FCn(*),SPEED_LIMITS_FCn(*)';
weboptions('ContentType','text','RequestMethod','POST')
payload = fileread('AudiRoute_Section01.gpx');
response = webwrite(url,payload);
////
The response was,
////
Error using matlab.internal.webservices.HTTPConnector/copyContentToByteArray (line 396)
The server returned the status 400 with message "" in response to the request to URL
https://fleet.cit.api.here.com/2/calculateroute.json?routeMatch=1&mode=car&app_id=ABCDEFGHIJK&app_code=ABCDEFGHIJK&attributes=ROAD_GEOM_FCn%28%2A%29,SPEED_LIMITS_FCn%28%2A%29,ADAS_ATTRIB_FCn%28%2A%29,LINK_ATTRIBUTE_FCn%28%2A%29.
Error in readContentFromWebService (line 46)
byteArray = copyContentToByteArray(connection);
Error in webwrite (line 139)
[varargout{1:nargout}] = readContentFromWebService(connection, options);
Error in rest (line 4)
response = webwrite(url,payload);
///
Can anyone help here?
Thanks in Advance.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Desktop dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!