I'm relatively new to AWS lambda function and nodejs. I'm working on to try and get the list of 5 cities in a country by using HTTP POST request from this website: "http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCountry"
I've been searching about how to do a HTTP POST request in lambda function but I can't seem to find a good explanation for it.
Searches that I found for http post:
https://www.npmjs.com/package/http-post How to make an HTTP POST request in node.js?
Try the following sample, invoking HTTP GET or POST request in nodejs from AWS lambda
Consider the sample
I had difficulty implementing the other answers so I'm posting what worked for me.
In this case the function receives url, path and post data
Lambda function
Example of call parameters
Use HTTP object and use
POST
as the request type. HTTP requests in AWS Lambda are no different from HTTP requests using NodeJS.Let me know if you need any more help.