AwsALBResponse constructor

AwsALBResponse(
  1. {dynamic body,
  2. dynamic headers,
  3. dynamic isBase64Encoded,
  4. dynamic statusCode,
  5. dynamic statusDescription}
)

The Response that should be returned to the Application Load Balancer. It is constructed with some default values for the optional parameters.

Implementation

AwsALBResponse(
    {body, headers, isBase64Encoded, statusCode, statusDescription}) {
  this.body = body ?? '';
  this.isBase64Encoded = isBase64Encoded ?? false;
  this.headers = headers ?? {"Content-Type": "text/html; charset=utf-8"};
  this.statusCode = statusCode ?? HttpStatus.ok;
  this.statusDescription = statusDescription ?? "200 OK";
}