Error 400

4 posts / 0 new
Last post
iwaraich
Error 400

Hi

Im having an issue with the mapping and routing where occasionally I get a "Error processing route request:".

My route options are as follows:

    routeOptions = {
      start: startLatLng,
      end: endLatLng,
      waypoints: aryLatLng,
      optimizeWaypoints: true,
      options: {
        doReverseGeocode: false
      }
    }

 

and the mapquest call is made as follows:

L.mapquest.directions().route(routeOptions, function(err, response) {...

However, I intermittently get an error (in Chrome and IE) - the response object is as below, I have removed the lat/lng from response below, but the error is at the position that reads,"useTraffic":true,%, 

{"route":{"routeError":{"errorCode":0,"message":""}},"info":{"statuscode":400,"copyright":{"imageAltText":"© 2018 MapQuest, Inc.", "imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","text":"© 2018 MapQuest, Inc."}, "messages":["Error processing route request: ","Error parsing JSON from Request: Expected a ':' after a key at character 2407 of {"locations":[]},"options":{"shapeFormat":"cmp6","timeType":1,"useTraffic":true,%, Please see the documentation for the Directions Service at http://open.mapquestapi.com/directions/ for details on correctly formatting requests."]}}

The % seems to be the culprit - but I have no idea what is happening as this is after the call and the error is only in the response from the service.

Any help/guidance much appreciated!

 

 


MQBrianCoakley
Can you post the request

Can you post the request being made to the route api?

 

Is the useTraffic parameter set in the application code with the %?


iwaraich
Think its the proxy config!

I think this is actually a proxy config option on the network that is limiting the request length to 2407 chars - and hence truncating the GET request.

Many thanks!

 

 


MQBrianCoakley
You're welcome.
You're welcome.