2022-04-06 20:35:34 -07:00
from enum import Enum
2022-04-06 21:14:32 -07:00
2022-04-06 20:35:34 -07:00
class Method ( str , Enum ) :
2023-05-04 00:58:06 -07:00
""" The Request Method (VERB)
This type also contains constants for a number of common HTTP methods such as GET , POST , etc .
2023-07-31 12:50:30 -07:00
Currently includes 8 variants representing the 8 methods defined in [ RFC 7230 ] ( https : / / tools . ietf . org / html / rfc7231 #section-4.1), plus PATCH, and an Extension variant for all extensions.
""" # noqa: E501
2023-05-04 00:58:06 -07:00
""" # The `OPTIONS` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.2.1). """ # noqa: E501
OPTIONS = " OPTIONS "
""" # The `GET` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1). """ # noqa: E501
GET = " GET "
""" # The `POST` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1). """ # noqa: E501
POST = " POST "
""" # The `PUT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1). """ # noqa: E501
PUT = " PUT "
""" # The `DELETE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.5). """ # noqa: E501
DELETE = " DELETE "
""" # The `HEAD` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.2). """ # noqa: E501
HEAD = " HEAD "
""" # The `TRACE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3). """ # noqa: E501
TRACE = " TRACE "
""" # The `CONNECT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.6). """ # noqa: E501
CONNECT = " CONNECT "
""" # The `PATCH` method as defined in [RFC 5789](https://tools.ietf.org/html/rfc5789). """ # noqa: E501
PATCH = " PATCH "
""" # A catch all. """ # noqa: E501
EXTENSION = " EXTENSION "
2022-04-06 20:35:34 -07:00
2022-04-06 21:14:32 -07:00
def __str__ ( self ) - > str :
return str ( self . value )