HTTP Constant Enumerations¶
This module contains all constant enumerations of
HTTP implementations. Available
enumerations include:
HTTP/2 Error Code [*] |
|
HTTP/2 Frame Type [†] |
|
HTTP/1.* Method [‡] |
|
HTTP/2 Settings [§] |
|
HTTP/1.* Status Code [¶] |
HTTP/2 Error Code¶
This module contains the constant enumeration for HTTP/2 Error Code,
which is automatically generated from pcapkit.vendor.http.error_code.ErrorCode.
- class pcapkit.const.http.error_code.ErrorCode(*values)[source]¶
Bases:
EnumRegistry,IntEnum[ErrorCode] HTTP/2 Error Code
- NO_ERROR = 0¶
NO_ERROR, Graceful shutdown [RFC 9113 Section 7]
- PROTOCOL_ERROR = 1¶
PROTOCOL_ERROR, Protocol error detected [RFC 9113 Section 7]
- INTERNAL_ERROR = 2¶
INTERNAL_ERROR, Implementation fault [RFC 9113 Section 7]
- FLOW_CONTROL_ERROR = 3¶
FLOW_CONTROL_ERROR, Flow-control limits exceeded [RFC 9113 Section 7]
- SETTINGS_TIMEOUT = 4¶
SETTINGS_TIMEOUT, Settings not acknowledged [RFC 9113 Section 7]
- STREAM_CLOSED = 5¶
STREAM_CLOSED, Frame received for closed stream [RFC 9113 Section 7]
- FRAME_SIZE_ERROR = 6¶
FRAME_SIZE_ERROR, Frame size incorrect [RFC 9113 Section 7]
- REFUSED_STREAM = 7¶
REFUSED_STREAM, Stream not processed [RFC 9113 Section 7]
- CANCEL = 8¶
CANCEL, Stream cancelled [RFC 9113 Section 7]
- COMPRESSION_ERROR = 9¶
COMPRESSION_ERROR, Compression state not updated [RFC 9113 Section 7]
- CONNECT_ERROR = 10¶
CONNECT_ERROR, TCP connection error for CONNECT method [RFC 9113 Section 7]
- ENHANCE_YOUR_CALM = 11¶
ENHANCE_YOUR_CALM, Processing capacity exceeded [RFC 9113 Section 7]
- INADEQUATE_SECURITY = 12¶
INADEQUATE_SECURITY, Negotiated TLS parameters not acceptable [RFC 9113 Section 7]
- HTTP_1_1_REQUIRED = 13¶
HTTP_1_1_REQUIRED, Use HTTP/1.1 for the request [RFC 9113 Section 7]
HTTP/2 Frame Type¶
This module contains the constant enumeration for HTTP/2 Frame Type,
which is automatically generated from pcapkit.vendor.http.frame.Frame.
- class pcapkit.const.http.frame.Frame(*values)[source]¶
Bases:
EnumRegistry,IntEnum[Frame] HTTP/2 Frame Type
- DATA = 0¶
DATA[RFC 9113 Section 6.1]
- HEADERS = 1¶
HEADERS[RFC 9113 Section 6.2]
- PRIORITY = 2¶
PRIORITY[RFC 9113 Section 6.3]
- RST_STREAM = 3¶
RST_STREAM[RFC 9113 Section 6.4]
- SETTINGS = 4¶
SETTINGS[RFC 9113 Section 6.5]
- PUSH_PROMISE = 5¶
PUSH_PROMISE[RFC 9113 Section 6.6]
- PING = 6¶
PING[RFC 9113 Section 6.7]
- GOAWAY = 7¶
GOAWAY[RFC 9113 Section 6.8]
- WINDOW_UPDATE = 8¶
WINDOW_UPDATE[RFC 9113 Section 6.9]
- CONTINUATION = 9¶
CONTINUATION[RFC 9113 Section 6.10]
- ALTSVC = 10¶
ALTSVC[RFC 7838 Section 4]
- Unassigned_0x0B = 11¶
Unassigned
HTTP Method¶
This module contains the constant enumeration for HTTP Method,
which is automatically generated from pcapkit.vendor.http.method.Method.
- class pcapkit.const.http.method.Method(*values)[source]¶
Bases:
EnumRegistry,StrEnum[Method] HTTP Method
Note
Neither
_missing_norget()mints any more. The owner ruled on GitHub issue #860 thatgetshould not mint: only IANA-registered values are legitimate members, a new one is properly created throughregister(), andgetis not given enough information to create one. Concretely true here – a bare wire method verb carries nosafe/idempotent, so minting one used to register a permanent member with both hollowed out to their defaults;register()is the path that can actually supply them.- ACL = 'ACL'¶
ACL [RFC 3744 Section 8.1]
- BASELINE_CONTROL = 'BASELINE-CONTROL'¶
BASELINE-CONTROL [RFC 3253 Section 12.6]
- BIND = 'BIND'¶
BIND [RFC 5842 Section 4]
- CHECKIN = 'CHECKIN'¶
CHECKIN [RFC 3253 Section 9.4]
- CHECKOUT = 'CHECKOUT'¶
CHECKOUT [RFC 3253 Section 8.8]
- CONNECT = 'CONNECT'¶
CONNECT [RFC 9110 Section 9.3.6]
- COPY = 'COPY'¶
COPY [RFC 4918 Section 9.8]
- DELETE = 'DELETE'¶
DELETE [RFC 9110 Section 9.3.5]
- GET = 'GET'¶
GET [RFC 9110 Section 9.3.1]
- HEAD = 'HEAD'¶
HEAD [RFC 9110 Section 9.3.2]
- LABEL = 'LABEL'¶
LABEL [RFC 3253 Section 8.2]
- LINK = 'LINK'¶
LINK [RFC 2068 Section 19.6.1.2]
- LOCK = 'LOCK'¶
LOCK [RFC 4918 Section 9.10]
- MERGE = 'MERGE'¶
MERGE [RFC 3253 Section 11.2]
- MKACTIVITY = 'MKACTIVITY'¶
MKACTIVITY [RFC 3253 Section 13.5]
- MKCALENDAR = 'MKCALENDAR'¶
MKCALENDAR [RFC 4791 Section 5.3.1][RFC 8144 Section 2.3]
- MKCOL = 'MKCOL'¶
MKCOL [RFC 4918 Section 9.3][RFC 5689 Section 3][RFC 8144 Section 2.3]
- MKREDIRECTREF = 'MKREDIRECTREF'¶
MKREDIRECTREF [RFC 4437 Section 6]
- MKWORKSPACE = 'MKWORKSPACE'¶
MKWORKSPACE [RFC 3253 Section 6.3]
- MOVE = 'MOVE'¶
MOVE [RFC 4918 Section 9.9]
- OPTIONS = 'OPTIONS'¶
OPTIONS [RFC 9110 Section 9.3.7]
- ORDERPATCH = 'ORDERPATCH'¶
ORDERPATCH [RFC 3648 Section 7]
- PATCH = 'PATCH'¶
PATCH [RFC 5789 Section 2]
- POST = 'POST'¶
POST [RFC 9110 Section 9.3.3]
- PRI = 'PRI'¶
PRI [RFC 9113 Section 3.4]
- PROPFIND = 'PROPFIND'¶
PROPFIND [RFC 4918 Section 9.1][RFC 8144 Section 2.1]
- PROPPATCH = 'PROPPATCH'¶
PROPPATCH [RFC 4918 Section 9.2][RFC 8144 Section 2.2]
- PUT = 'PUT'¶
PUT [RFC 9110 Section 9.3.4]
- QUERY = 'QUERY'¶
QUERY [RFC 10008 Section 2]
- REBIND = 'REBIND'¶
REBIND [RFC 5842 Section 6]
- REPORT = 'REPORT'¶
REPORT [RFC 3253 Section 3.6][RFC 8144 Section 2.1]
- SEARCH = 'SEARCH'¶
SEARCH [RFC 5323 Section 2]
- TRACE = 'TRACE'¶
TRACE [RFC 9110 Section 9.3.8]
- UNBIND = 'UNBIND'¶
UNBIND [RFC 5842 Section 5]
- UNCHECKOUT = 'UNCHECKOUT'¶
UNCHECKOUT [RFC 3253 Section 4.5]
- UNLINK = 'UNLINK'¶
UNLINK [RFC 2068 Section 19.6.1.3]
- UNLOCK = 'UNLOCK'¶
UNLOCK [RFC 4918 Section 9.11]
- UPDATE = 'UPDATE'¶
UPDATE [RFC 3253 Section 7.1]
- UPDATEREDIRECTREF = 'UPDATEREDIRECTREF'¶
UPDATEREDIRECTREF [RFC 4437 Section 7]
- VERSION_CONTROL = 'VERSION-CONTROL'¶
VERSION-CONTROL [RFC 3253 Section 3.5]
- classmethod _unregistered_member(value, name)[source]¶
Build a member absent from this registry’s own lookup tables.
Leaves
safeandidempotentat the same defaults__new__()itself would, rather than missing entirely –_unregistered_member()bypasses__new__()(it callsstr’s directly), so those two attributes would otherwise be absent. There is no more specific value to reconstruct them from – a bare wire method verb carries neither, which is exactly the owner’s reasoning for whyget()/_missing_must not mint one:register()is the path that can actually supply them.- Parameters:
value (
str) –Value to get enum item – the convention here, shared with
FEATCodeandCommand, is the caller’s own casing, unchanged: an unregistered member’s value is exactly what was observed on the wire, matching how a registered member’s own value is exactly what was declared, never reformatted. Onlyname– the identifier, not the value – is canonicalised.A registered member of this class used to carry something different here: GitHub issue #870 found that
__new__()calledstr.__new__(cls)with no argument at all, so every one of the 40 declared members’ ownstrpayload was permanently empty regardless ofvalue(str(Method.GET) == '', andMethod.GET == 'GET'wasFalse) – true onmainat60b85e3a4as well as when this docstring was first written. #870 fixed__new__()tostr.__new__(cls, value), mirroringCommand’s own__new__, so a registered member’s payload now agrees with an unregistered member built through this method: both carry their own value as realstrcontent (str(Method('frob')) == 'frob').name (
str) – Bare label for the unregistered member – here, the canonical upper-case form ofvalue, matching the name every registered member of this class is looked up by, since #860’s open-vocabulary registries have no manufactured placeholder label to fall back to.
- Return type:
- classmethod _missing_(value)[source]¶
Lookup function used when value is not found.
- Parameters:
value (
str) – Value to get enum item. Matched case-insensitively against the canonical upper-case member names – deliberately unlikeget(), which is case-sensitive per RFC 9110 Section 9.1. The split was ruled deliberate on GitHub issue #896; GitHub issue #908 is the pointer between the two, so a reader of this one file is not left with two contradictory rationales and nothing tying them together.- Return type:
- static _generate_next_value_(name, start, count, last_values)¶
Return the lower-cased version of the member name.
HTTP/2 Settings¶
This module contains the constant enumeration for HTTP/2 Settings,
which is automatically generated from pcapkit.vendor.http.setting.Setting.
- class pcapkit.const.http.setting.Setting(*values)[source]¶
Bases:
EnumRegistry,IntEnum[Setting] HTTP/2 Settings
- HEADER_TABLE_SIZE = 1¶
- Type:
HEADER_TABLE_SIZE[RFC 9113 Section 6.5.2] (Initial Value
- ENABLE_PUSH = 2¶
- Type:
ENABLE_PUSH[RFC 9113 Section 6.5.2] (Initial Value
- MAX_CONCURRENT_STREAMS = 3¶
MAX_CONCURRENT_STREAMS[RFC 9113 Section 6.5.2] (Initial Value: infinite)
- INITIAL_WINDOW_SIZE = 4¶
- Type:
INITIAL_WINDOW_SIZE[RFC 9113 Section 6.5.2] (Initial Value
- MAX_FRAME_SIZE = 5¶
- Type:
MAX_FRAME_SIZE[RFC 9113 Section 6.5.2] (Initial Value
- MAX_HEADER_LIST_SIZE = 6¶
MAX_HEADER_LIST_SIZE[RFC 9113 Section 6.5.2] (Initial Value: infinite)
- Unassigned_0x0007 = 7¶
Unassigned
- SETTINGS_ENABLE_CONNECT_PROTOCOL = 8¶
- Type:
SETTINGS_ENABLE_CONNECT_PROTOCOL[RFC 8441] (Initial Value
- TLS_RENEG_PERMITTED = 16¶
TLS_RENEG_PERMITTED[MS-HTTP2E][Gabriel Montenegro] (Initial Value: 0x00)
- SETTINGS_ENABLE_METADATA = 19780¶
SETTINGS_ENABLE_METADATA[draft-beky-httpbis-metadata-02] (Initial Value: 0)
HTTP Status Code¶
This module contains the constant enumeration for HTTP Status Code,
which is automatically generated from pcapkit.vendor.http.status_code.StatusCode.
- class pcapkit.const.http.status_code.StatusCode(*values)[source]¶
Bases:
EnumRegistry,IntEnum[StatusCode] HTTP Status Code
- CODE_100 = 100¶
Continue [RFC 9110 Section 15.2.1]
- CODE_101 = 101¶
Switching Protocols [RFC 9110 Section 15.2.2]
- CODE_104 = 104¶
Upload Resumption Supported (TEMPORARY - registered 2024-11-13, extension registered 2025-09-15, expires 2026-11-13) [draft-ietf-httpbis-resumable- upload-05]
- CODE_200 = 200¶
- CODE_201 = 201¶
Created [RFC 9110 Section 15.3.2]
- CODE_202 = 202¶
Accepted [RFC 9110 Section 15.3.3]
- CODE_203 = 203¶
Non-Authoritative Information [RFC 9110 Section 15.3.4]
- CODE_204 = 204¶
No Content [RFC 9110 Section 15.3.5]
- CODE_205 = 205¶
Reset Content [RFC 9110 Section 15.3.6]
- CODE_206 = 206¶
Partial Content [RFC 9110 Section 15.3.7]
- CODE_300 = 300¶
Multiple Choices [RFC 9110 Section 15.4.1]
- CODE_301 = 301¶
Moved Permanently [RFC 9110 Section 15.4.2]
- CODE_302 = 302¶
Found [RFC 9110 Section 15.4.3]
- CODE_303 = 303¶
See Other [RFC 9110 Section 15.4.4]
- CODE_304 = 304¶
Not Modified [RFC 9110 Section 15.4.5]
- CODE_305 = 305¶
Use Proxy [RFC 9110 Section 15.4.6]
- CODE_306 = 306¶
(Unused) [RFC 9110 Section 15.4.7]
- CODE_307 = 307¶
Temporary Redirect [RFC 9110 Section 15.4.8]
- CODE_308 = 308¶
Permanent Redirect [RFC 9110 Section 15.4.9]
- CODE_400 = 400¶
Bad Request [RFC 9110 Section 15.5.1]
- CODE_401 = 401¶
Unauthorized [RFC 9110 Section 15.5.2]
- CODE_402 = 402¶
Payment Required [RFC 9110 Section 15.5.3]
- CODE_403 = 403¶
Forbidden [RFC 9110 Section 15.5.4]
- CODE_404 = 404¶
Not Found [RFC 9110 Section 15.5.5]
- CODE_405 = 405¶
Method Not Allowed [RFC 9110 Section 15.5.6]
- CODE_406 = 406¶
Not Acceptable [RFC 9110 Section 15.5.7]
- CODE_407 = 407¶
Proxy Authentication Required [RFC 9110 Section 15.5.8]
- CODE_408 = 408¶
Request Timeout [RFC 9110 Section 15.5.9]
- CODE_409 = 409¶
Conflict [RFC 9110 Section 15.5.10]
- CODE_410 = 410¶
Gone [RFC 9110 Section 15.5.11]
- CODE_411 = 411¶
Length Required [RFC 9110 Section 15.5.12]
- CODE_412 = 412¶
Precondition Failed [RFC 9110 Section 15.5.13]
- CODE_413 = 413¶
Content Too Large [RFC 9110 Section 15.5.14]
- CODE_414 = 414¶
URI Too Long [RFC 9110 Section 15.5.15]
- CODE_415 = 415¶
Unsupported Media Type [RFC 9110 Section 15.5.16]
- CODE_416 = 416¶
Range Not Satisfiable [RFC 9110 Section 15.5.17]
- CODE_417 = 417¶
Expectation Failed [RFC 9110 Section 15.5.18]
- CODE_418 = 418¶
(Unused) [RFC 9110 Section 15.5.19]
- CODE_421 = 421¶
Misdirected Request [RFC 9110 Section 15.5.20]
- CODE_422 = 422¶
Unprocessable Content [RFC 9110 Section 15.5.21]
- CODE_426 = 426¶
Upgrade Required [RFC 9110 Section 15.5.22]
- CODE_427 = 427¶
Unassigned
- CODE_430 = 430¶
Unassigned
- CODE_500 = 500¶
Internal Server Error [RFC 9110 Section 15.6.1]
- CODE_501 = 501¶
Not Implemented [RFC 9110 Section 15.6.2]
- CODE_502 = 502¶
Bad Gateway [RFC 9110 Section 15.6.3]
- CODE_503 = 503¶
Service Unavailable [RFC 9110 Section 15.6.4]
- CODE_504 = 504¶
Gateway Timeout [RFC 9110 Section 15.6.5]
- CODE_505 = 505¶
HTTP Version Not Supported [RFC 9110 Section 15.6.6]
- CODE_509 = 509¶
Unassigned
- classmethod _unregistered_member(value, name)[source]¶
Build a member absent from this registry’s own lookup tables.
Reconstructs
messagethe same way__new__()would, rather than leaving it unset –_unregistered_member()bypasses__new__()entirely (it callsint’s directly), somessagewould otherwise be missing from the result and__str__()would raise on it.- Parameters:
- Return type:
Footnotes