pythong-requests 笔记

响应应状态码:requests.status_codes.py

 

 1 _codes = {
 2 
 3     # Informational.
 4     100: ('continue',),
 5     101: ('switching_protocols',),
 6     102: ('processing',),
 7     103: ('checkpoint',),
 8     122: ('uri_too_long', 'request_uri_too_long'),
 9     200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/', ''),
10     201: ('created',),
11     202: ('accepted',),
12     203: ('non_authoritative_info', 'non_authoritative_information'),
13     204: ('no_content',),
14     205: ('reset_content', 'reset'),
15     206: ('partial_content', 'partial'),
16     207: ('multi_status', 'multiple_status', 'multi_stati', 'multiple_stati'),
17     208: ('already_reported',),
18     226: ('im_used',),
19 
20     # Redirection.
21     300: ('multiple_choices',),
22     301: ('moved_permanently', 'moved', '\\o-'),
23     302: ('found',),
24     303: ('see_other', 'other'),
25     304: ('not_modified',),
26     305: ('use_proxy',),
27     306: ('switch_proxy',),
28     307: ('temporary_redirect', 'temporary_moved', 'temporary'),
29     308: ('permanent_redirect',
30           'resume_incomplete', 'resume',),  # These 2 to be removed in 3.0
31 
32     # Client Error.
33     400: ('bad_request', 'bad'),
34     401: ('unauthorized',),
35     402: ('payment_required', 'payment'),
36     403: ('forbidden',),
37     404: ('not_found', '-o-'),
38     405: ('method_not_allowed', 'not_allowed'),
39     406: ('not_acceptable',),
40     407: ('proxy_authentication_required', 'proxy_auth', 'proxy_authentication'),
41     408: ('request_timeout', 'timeout'),
42     409: ('conflict',),
43     410: ('gone',),
44     411: ('length_required',),
45     412: ('precondition_failed', 'precondition'),
46     413: ('request_entity_too_large',),
47     414: ('request_uri_too_large',),
48     415: ('unsupported_media_type', 'unsupported_media', 'media_type'),
49     416: ('requested_range_not_satisfiable', 'requested_range', 'range_not_satisfiable'),
50     417: ('expectation_failed',),
51     418: ('im_a_teapot', 'teapot', 'i_am_a_teapot'),
52     421: ('misdirected_request',),
53     422: ('unprocessable_entity', 'unprocessable'),
54     423: ('locked',),
55     424: ('failed_dependency', 'dependency'),
56     425: ('unordered_collection', 'unordered'),
57     426: ('upgrade_required', 'upgrade'),
58     428: ('precondition_required', 'precondition'),
59     429: ('too_many_requests', 'too_many'),
60     431: ('header_fields_too_large', 'fields_too_large'),
61     444: ('no_response', 'none'),
62     449: ('retry_with', 'retry'),
63     450: ('blocked_by_windows_parental_controls', 'parental_controls'),
64     451: ('unavailable_for_legal_reasons', 'legal_reasons'),
65     499: ('client_closed_request',),
66 
67     # Server Error.
68     500: ('internal_server_error', 'server_error', '/o\\', ''),
69     501: ('not_implemented',),
70     502: ('bad_gateway',),
71     503: ('service_unavailable', 'unavailable'),
72     504: ('gateway_timeout',),
73     505: ('http_version_not_supported', 'http_version'),
74     506: ('variant_also_negotiates',),
75     507: ('insufficient_storage',),
76     509: ('bandwidth_limit_exceeded', 'bandwidth'),
77     510: ('not_extended',),
78     511: ('network_authentication_required', 'network_auth', 'network_authentication'),
79 }

 

posted @ 2020-03-17 18:46  yanrufei  阅读(215)  评论(0)    收藏  举报