What is the difference between the GET and POST route directions API?

Larissa Taylor 40 Reputation points
2025-01-16T16:56:48.9866667+00:00

When using the route directions API, the responses that are returned are very different when you do a GET request versus when you do POST request. In the application that I'm building, right now I think I need to do both request types to acheive the desired functionality; specifically I'm trying to display a truck route with a single waypoint visually on the map and textually as directions. The RouteInstructionControl (for the textual directions, https://github.com/Azure-Samples/azure-maps-services-ui/blob/master/docs/RouteInstructionControl.md) only seems to be able to proces GET requests, but there's additional information in the POST request that I also need. Obviously I don't want to have to make the call twice every time but with my current knowledge and understanding I think I have to.

My biggest question is WHY are the responses so different, what is the difference between these two API request types for seemingly the same information and when should I use what? My secondary question is do I really have to use both request types to accomplish my goal?

Maybe if I understood a little more about the differences I could figure out how to simplify here. Any additional information or documentation that anyone can point me to would be very much appreciated! Thank you in advance.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
773 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.