Class AwsProxyHttpServletResponseWriter
java.lang.Object
com.amazonaws.serverless.proxy.ResponseWriter<AwsHttpServletResponse,AwsProxyResponse>
com.amazonaws.serverless.proxy.internal.servlet.AwsProxyHttpServletResponseWriter
public class AwsProxyHttpServletResponseWriter
extends ResponseWriter<AwsHttpServletResponse,AwsProxyResponse>
Creates an
AwsProxyResponse object given an AwsHttpServletResponse object. If the
response is not populated with a status code we infer a default 200 status code.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwriteResponse(AwsHttpServletResponse containerResponse, com.amazonaws.services.lambda.runtime.Context lambdaContext) Writes status code, headers, and body from the container response to a Lambda return value.Methods inherited from class com.amazonaws.serverless.proxy.ResponseWriter
isValidUtf8
-
Constructor Details
-
AwsProxyHttpServletResponseWriter
public AwsProxyHttpServletResponseWriter() -
AwsProxyHttpServletResponseWriter
public AwsProxyHttpServletResponseWriter(boolean singleValueHeaders)
-
-
Method Details
-
writeResponse
public AwsProxyResponse writeResponse(AwsHttpServletResponse containerResponse, com.amazonaws.services.lambda.runtime.Context lambdaContext) throws InvalidResponseObjectException Description copied from class:ResponseWriterWrites status code, headers, and body from the container response to a Lambda return value.- Specified by:
writeResponsein classResponseWriter<AwsHttpServletResponse,AwsProxyResponse> - Parameters:
containerResponse- The container response or response reader objectlambdaContext- The context for the Lambda function execution- Returns:
- A valid return value for the Lambda function
- Throws:
InvalidResponseObjectException- When the implementation cannot read the container response object
-