Skip to main content

Module response

Module response 

Source
Expand description

API Gateway v2 response serialization and error formatting.

API Gateway v2 uses a JSON body with a lowercase message field: {"message": "..."}

Constants§

CONTENT_TYPE
Content type for API Gateway v2 JSON responses.

Functions§

empty_response
Build an empty response with the given status code.
error_to_response
Convert an ApiGatewayV2Error into a complete HTTP error response.
json_response
Build a JSON success response with the given status code.