public APIGatewayV2ProxyResponseEvent handleRequest()

in sample-apps/java-events/src/main/java/example/Handler.java [19:34]


  public APIGatewayV2ProxyResponseEvent handleRequest(APIGatewayV2ProxyRequestEvent event, Context context)
  {
    LambdaLogger logger = context.getLogger();
    APIGatewayV2ProxyResponseEvent response = new APIGatewayV2ProxyResponseEvent();
    response.setIsBase64Encoded(false);
    response.setStatusCode(200);
    HashMap<String, String> headers = new HashMap<String, String>();
    headers.put("Content-Type", "text/html");
    response.setHeaders(headers);
    response.setBody("<!DOCTYPE html><html><head><title>AWS Lambda sample</title></head><body>"+
      "<h1>Welcome</h1><p>Page generated by a Lambda function.</p>" +
      "</body></html>");
    // log execution details
    Util.logEnvironment(event, context, gson);
    return response;
  }