Optimized Route - POST - Error 400

4 posts / 0 new
Last post
VehitrixCTO77
Optimized Route - POST - Error 400

I cannot send my JSON array of locations that has latitudes and longitudes to get the optimized route. It shows error code 400. Help please!


MQBrianCoakley
Does the POST data include
Does the POST data include "json=" before the json data?

VehitrixCTO77
No, right now my javascript

No, right now my javascript code looks like this 

$("#app2").click(function(event){
                    console.log("Getting Route");
                $.post("url",{
                    
                    "locations": locations // This is an array
                
                }).done(function(msg){
                        console.log(msg);
                }).fail(function(){
                        console.log("error")
                    });
                });


MQBrianCoakley
Can the data be prepended
Can the data be prepended with "json="? I suspect this will resolve the issue.