HttpMethod

class aws_cdk.aws_apigatewayv2.HttpMethod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Supported HTTP methods.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_apigatewayv2_integrations import HttpUrlIntegration, HttpLambdaIntegration

# book_store_default_fn: lambda.Function


get_books_integration = HttpUrlIntegration("GetBooksIntegration", "https://get-books-proxy.example.com")
book_store_default_integration = HttpLambdaIntegration("BooksIntegration", book_store_default_fn)

http_api = apigwv2.HttpApi(self, "HttpApi")

http_api.add_routes(
    path="/books",
    methods=[apigwv2.HttpMethod.GET],
    integration=get_books_integration
)
http_api.add_routes(
    path="/books",
    methods=[apigwv2.HttpMethod.ANY],
    integration=book_store_default_integration
)

Attributes

ANY

HTTP ANY.

DELETE

HTTP DELETE.

GET

HTTP GET.

HEAD

HTTP HEAD.

OPTIONS

HTTP OPTIONS.

PATCH

HTTP PATCH.

POST

HTTP POST.

PUT

HTTP PUT.