Reputation: 617
I am very new to web development and using any google services api.
I know I can send HTTP GET with the following format: http://maps.googleapis.com/maps/api/geocode/json?address=CA
I am reading the documentation and it seems that it only talks about HTTP GET requests: https://developers.google.com/maps/web-services/overview
Does anyone have any experience sending HTTP POST request to google maps apis or it is just not accepted?
Upvotes: 0
Views: 4805
Reputation: 3848
Based on the Google Maps API documentation https://developers.google.com/maps/web-services/overview you don't have the option to send POST requests but only GET.
Now as your post doesn't provide more infos on how you tried to do it, my suggestion is to create a middleware that will handle those requests.
This is kinda of onverengineering as the parameters will still appear to the user if you are trying to redirect them but it will be a good case if you don't.
You can create a simple node.js
middleware that will have a POST
API that you'll send the data the way you want and within this request in the middleware you will transform the data and send them with a GET method to the Gmaps Api.
You can use Express
to create a middleware without a lot of effort.
You can read more here: https://expressjs.com/en/guide/writing-middleware.html
Upvotes: 5