AwsApiGatewayResponse.fromJson constructor

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

The factory creates a new AwsApiGatewayResponse from JSON. It optionally accepts the Base64 encoded flag and a HTTP Status Code for the response.

Implementation

factory AwsApiGatewayResponse.fromJson(
  Map<String, dynamic> body, {
  bool isBase64Encoded = false,
  int statusCode = 200,
  Map<String, String> headers = const {},
}) =>
    AwsApiGatewayResponse(
      json.encode(body),
      isBase64Encoded: isBase64Encoded,
      statusCode: statusCode,
      headers: headers,
    );