AwsALBResponse constructor

AwsALBResponse(
  1. {String? body,
  2. Map<String, String>? headers,
  3. bool? isBase64Encoded,
  4. int? statusCode,
  5. String? 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({
  String? body,
  Map<String, String>? headers,
  bool? isBase64Encoded,
  int? statusCode,
  String? 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';
}