VROOM-Project / vroom

Vehicle Routing Open-source Optimization Machine
http://vroom-project.org/
BSD 2-Clause "Simplified" License
1.32k stars 333 forks source link

Error http request to backend demo server #1163

Open haditabealhojeh opened 6 days ago

haditabealhojeh commented 6 days ago

Hi. when I sewn below http request, I got {"code":2,"error":"Invalid JSON object in request, please add vehicles and jobs or shipments to the object body"}

my command (according to link) curl --header "Content-Type:application/json" --data '{"vehicles":[{"id":0,"start":[2.3526,48.8604],"end":[2.3526,48.8604]}],"jobs":[{"id":0,"location":[2.3691,48.8532]},{"id":1,"location":[2.2911,48.8566]}]}' http://solver.vroom-project.org

I also have installed Vroom on my server and I got the same error.

jcoupey commented 6 days ago

This error appears when there is a json error in the payload. The weird thing is that the exact same command works from my terminal. Can you maybe try putting the data in an input.json file and instead run:

curl --header "Content-Type:application/json" --data @input.json http://solver.vroom-project.org