Skip to content
Myr

constants.py

This file

Path

httpcore/constants.py

67 lines · 2.0 KiB · Python

Last changed by

Reorganise structureTom Christiebefore adoption0c6f618

History of this file

Take it

1import enum234class Protocol(str, enum.Enum):5    HTTP_11 = "HTTP/1.1"6    HTTP_2 = "HTTP/2"789codes = enum.IntEnum(10    "StatusCode",11    [12        ("continue", 100),13        ("switching_protocols", 101),14        ("processing", 102),15        ("ok", 200),16        ("created", 201),17        ("accepted", 202),18        ("non_authoritative_information", 203),19        ("no_content", 204),20        ("reset_content", 205),21        ("partial_content", 206),22        ("multi_status", 207),23        ("already_reported", 208),24        ("im_used", 226),25        ("multiple_choices", 300),26        ("moved_permanently", 301),27        ("found", 302),28        ("see_other", 303),29        ("not_modified", 304),30        ("use_proxy", 305),31        ("temporary_redirect", 307),32        ("permanent_redirect", 308),33        ("bad_request", 400),34        ("unauthorized", 401),35        ("payment_required", 402),36        ("forbidden", 403),37        ("not_found", 404),38        ("method_not_allowed", 405),39        ("not_acceptable", 406),40        ("proxy_authentication_required", 407),41        ("request_timeout", 408),42        ("conflict", 409),43        ("gone", 410),44        ("length_required", 411),45        ("precondition_failed", 412),46        ("request_entity_too_large", 413),47        ("request_uri_too_long", 414),48        ("unsupported_media_type", 415),49        ("requested_range_not_satisfiable", 416),50        ("expectation_failed", 417),51        ("unprocessable_entity", 422),52        ("locked", 423),53        ("failed_dependency", 424),54        ("precondition_required", 428),55        ("too_many_requests", 429),56        ("request_header_fields_too_large", 431),57        ("unavailable_for_legal_reasons", 451),58        ("internal_server_error", 500),59        ("not_implemented", 501),60        ("bad_gateway", 502),61        ("service_unavailable", 503),62        ("gateway_timeout", 504),63        ("http_version_not_supported", 505),64        ("insufficient_storage", 507),65        ("network_authentication_required", 511),66    ],67)