AwsApiGatewayResponse class
API Gateway Response contains the data for a response
to the API Gateway. It contains the body of the HTTP response.
It also contains a HTTP Status Code which by default is 200
.
Furthermore it indicates if the body is Base64 encoded or not.
Constructors
-
AwsApiGatewayResponse({String? body, bool isBase64Encoded = false, Map<
String, String> ? headers, 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 thebody
is Base64 encoded and what the HTTP Status Code of the response is. -
AwsApiGatewayResponse.fromJson(Map<
String, dynamic> body, {bool isBase64Encoded = false, int statusCode = HttpStatus.ok, Map<String, String> ? headers}) -
The factory creates a new AwsApiGatewayResponse from JSON.
It optionally accepts the Base64 encoded flag and a HTTP Status Code
for the response.
factory
Properties
- body ↔ String?
-
The body of the HTTP Response send from the API Gateway to the client.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
↔ Map<
String, String> ? -
The HTTP headers that should be send with the response to the client.
getter/setter pair
- isBase64Encoded ↔ bool?
-
Indicates if the body is Base64 encoded or not. By default is
false
.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCode ↔ int?
-
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Returns the JSON representation of the response. This is called by the JSON encoder to produce the response.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited