Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to POST request to postman using AWS Lambda

Is it possible to make an http request using postman to an AWS Lambda function? I want to get the response from postman but I don't know how to do that using lambda.

like image 887
San Avatar asked Mar 03 '19 14:03

San


2 Answers

I assume you meant how to make an HTTP request FROM Postman to Lambda?

No, you cannot do it as AWS Lambda is not an HTTP Service itself. What you could do, instead, would be to have an API Gateway trigger your Lambda function.

There's an example of how to achieve such a thing here

If you already have an existing application running, then you may call your Lambda function by its name or use one of the many other triggers available for Lambda.

You can check Supported Event Sources for more information.

EDIT:

As of April 2022, it is possible to assign a URL to a Lambda Function.

From the docs:

A function URL is a dedicated HTTP(S) endpoint for your Lambda function. You can create and configure a function URL through the Lambda console or the Lambda API. When you create a function URL, Lambda automatically generates a unique URL endpoint for you.

like image 85
Thales Minussi Avatar answered Oct 21 '22 17:10

Thales Minussi


Yes, it is definitely possible. But you have to understand that AWS Lambda was designed to work hand-in-hand with AWS Gateway. First, you need to configure AWS Gateway to route requests with a certain URI and HTTP method to your Lambda (for example, a POST request with the URI /myFunction). You can then use Postman to send HTTP requests to that Lambda, as explained in the official documentation.

like image 2
Nadav Avatar answered Oct 21 '22 18:10

Nadav