title: Locally Invoke AWS Lambda functions using container
body: <p>So i have been trying to explore the Lambda container image</p>
  <p>i have a lambda function as follows</p>
  <p><strong>test.go:</strong></p>
  <pre><code>package main
  
  import (
      &quot;context&quot;
      &quot;fmt&quot;
      &quot;github.com/aws/aws-lambda-go/events&quot;
      &quot;github.com/aws/aws-lambda-go/lambda&quot;
  )
  
  
  func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
  
      fmt.Println(&quot;Request %s \n\n&quot;, request)
      fmt.Println(&quot;Context %s \n\n&quot;, ctx)
  
      name := request.QueryStringParameters[&quot;name&quot;]
  
      return events.APIGatewayProxyResponse{Body: fmt.Sprint(&quot;Hello %s&quot;, name), StatusCode: 200}, nil
  }
  
  func main() {
      lambda.Start(handleRequest)
  }
  
  </code></pre>
  <p>My Docker File as :</p>
  <pre><code>FROM amazon/aws-lambda-go
  
  COPY bin/test /var/task
  
  CMD [ &quot;test&quot; ]
  
  </code></pre>
  <p>I build the above docker file with tag as testing_go, and run it as follows</p>
  <pre><code>docker run -p 8080:8080 testing_go
  </code></pre>
  <p>and try to invoke this as follows</p>
  <pre><code>curl -X GET --url http://localhost:8080/2015-03-31/functions/function/invocations?name=JOHN --header 'Content-Type: application/json' --data '{}'
  </code></pre>
  <p>i see that the container log shows the following for the values of context and request</p>
  <pre><code>Request %s 
  
   {   map[] map[] map[] map[] map[] map[] {        {            }  map[]   0 }  false}
  Context %s 
  
   context.Background.WithDeadline(2020-12-23 03:07:06.186819041 +0000 UTC [325h22m17.998420615s]).WithValue(type *lambdacontext.key, val &lt;not Stringer&gt;).WithValue(type string, val )
  map[]
  </code></pre>
  <p>Question:</p>
  <ol>
  <li>how do i invoke the function locally via curl so that i can capture the Querystring parameters in my Go lang code?</li>
  </ol>
  <p>It would be really helpful if someone can help me out with this .</p>
  <p>EDIT:
  After breaking my head for a while i was able to figure it out .
  answer to it was</p>
  <pre><code>curl -X GET --url http://localhost:8080/2015-1/functions/function/invocations --header 'Content-Type: application/json' --data '{&quot;queryStringParameters&quot;: {&quot;name&quot;: &quot;john&quot;}}'
  </code></pre>