AwsApiGatewayResponse constructor

AwsApiGatewayResponse(
  1. {String? body,
  2. bool isBase64Encoded = false,
  3. Map<String, String>? headers,
  4. int? statusCode}
)

The Response that should be returned by the API Gateway for the Lambda invocation. It has a body which reflects the body of the HTTP Response. But also it signals if the body is Base64 encoded and what the HTTP Status Code of the response is.

Implementation

AwsApiGatewayResponse({
  String? body,
  bool isBase64Encoded = false,
  Map<String, String>? headers,
  int? statusCode,
}) {
  this.body = body;
  this.isBase64Encoded = isBase64Encoded;
  this.headers = headers ?? {'Content-Type': 'application/json'};
  this.statusCode = statusCode ?? HttpStatus.ok;
}