目录
本文是全系列中第4 / 23篇:python学习记
- python request 使用代理服务器访问
- python request 对应的HTTP Header头
- Python request 携带cookies访问
- Python Request 请求的时候HTTP status code的响应代码是什么意思
- 这个问题好麻烦,使用了python的xmlrpc 发布数据,但是这个wordpress总会有502这个错误产生
- List of Dictionaries 是什么类型
- 这两个怎么会不一样呢,list还是dict,都是list的话又有什么区别呢
- 这种字符串到底是list还是dict,傻傻分不清怎么办?Python遇到这种List[dict]怎么取出中间的数值呢
- python遇到wordpress xmlrpc 模块的AttributeError: module 'collections' has no attribute 'Iterable'问题怎么解决
- 为什么我的python的request的结果都是不能格式化成json输出呢
- python操作文件常用到的函数
- 太恶心了,直接反编译一下再修改得了
- google翻译的API竟然还是按小时收费的,那就算了
- 简直是可以吐血身亡了,learndash本身就支持这样的api直接使用api调用就行了
- 如果是pyinstall编译过的exe程序可以直接使用这个软件反编译出来
- 使用python可以直接在selenium采集就可以了
- 搞了半天,我用pyinstall解决不了的问题用pythonautopy解决了
- woocommerce的REST API没有写这个tag怎么写入,但是我读取了一个看到这个格式其实还是这样子的。。。
- sql过滤语句测试
- python更新mysql的update语句竟然是这两个标点符号的问题
- mysql的这个sql语句为什么总是更新失败呢...
- 计划: python实现图片下载自动分类
- woocommerce直接创建一个REST API接口,太方便了。。。
https://docs.python.org/3/library/http.html
HTTP响应代码非常多,但是可以分成这么几类:
1开头的,主要是信息提示
2开头的,成功(比如200一般代表正常返回结果)
3开头的,重定向的(比如301代表重定向到别的地方)
4开头的:客户端的错误(比如401是认证错误,404是找不到)
5开头的,是服务器的错误(比如500常见的就是程序执行出错)
HTTP status codes
Supported, IANA-registered status codes available in http.HTTPStatus
are:
Code | Enum Name | Details |
---|---|---|
100 |
CONTINUE |
HTTP/1.1 RFC 7231, Section 6.2.1 |
101 |
SWITCHING_PROTOCOLS |
HTTP/1.1 RFC 7231, Section 6.2.2 |
102 |
PROCESSING |
WebDAV RFC 2518, Section 10.1 |
103 |
EARLY_HINTS |
An HTTP Status Code for Indicating Hints RFC 8297 |
200 |
OK |
HTTP/1.1 RFC 7231, Section 6.3.1 |
201 |
CREATED |
HTTP/1.1 RFC 7231, Section 6.3.2 |
202 |
ACCEPTED |
HTTP/1.1 RFC 7231, Section 6.3.3 |
203 |
NON_AUTHORITATIVE_INFORMATION |
HTTP/1.1 RFC 7231, Section 6.3.4 |
204 |
NO_CONTENT |
HTTP/1.1 RFC 7231, Section 6.3.5 |
205 |
RESET_CONTENT |
HTTP/1.1 RFC 7231, Section 6.3.6 |
206 |
PARTIAL_CONTENT |
HTTP/1.1 RFC 7233, Section 4.1 |
207 |
MULTI_STATUS |
WebDAV RFC 4918, Section 11.1 |
208 |
ALREADY_REPORTED |
WebDAV Binding Extensions RFC 5842, Section 7.1 (Experimental) |
226 |
IM_USED |
Delta Encoding in HTTP RFC 3229, Section 10.4.1 |
300 |
MULTIPLE_CHOICES |
HTTP/1.1 RFC 7231, Section 6.4.1 |
301 |
MOVED_PERMANENTLY |
HTTP/1.1 RFC 7231, Section 6.4.2 |
302 |
FOUND |
HTTP/1.1 RFC 7231, Section 6.4.3 |
303 |
SEE_OTHER |
HTTP/1.1 RFC 7231, Section 6.4.4 |
304 |
NOT_MODIFIED |
HTTP/1.1 RFC 7232, Section 4.1 |
305 |
USE_PROXY |
HTTP/1.1 RFC 7231, Section 6.4.5 |
307 |
TEMPORARY_REDIRECT |
HTTP/1.1 RFC 7231, Section 6.4.7 |
308 |
PERMANENT_REDIRECT |
Permanent Redirect RFC 7238, Section 3 (Experimental) |
400 |
BAD_REQUEST |
HTTP/1.1 RFC 7231, Section 6.5.1 |
401 |
UNAUTHORIZED |
HTTP/1.1 Authentication RFC 7235, Section 3.1 |
402 |
PAYMENT_REQUIRED |
HTTP/1.1 RFC 7231, Section 6.5.2 |
403 |
FORBIDDEN |
HTTP/1.1 RFC 7231, Section 6.5.3 |
404 |
NOT_FOUND |
HTTP/1.1 RFC 7231, Section 6.5.4 |
405 |
METHOD_NOT_ALLOWED |
HTTP/1.1 RFC 7231, Section 6.5.5 |
406 |
NOT_ACCEPTABLE |
HTTP/1.1 RFC 7231, Section 6.5.6 |
407 |
PROXY_AUTHENTICATION_REQUIRED |
HTTP/1.1 Authentication RFC 7235, Section 3.2 |
408 |
REQUEST_TIMEOUT |
HTTP/1.1 RFC 7231, Section 6.5.7 |
409 |
CONFLICT |
HTTP/1.1 RFC 7231, Section 6.5.8 |
410 |
GONE |
HTTP/1.1 RFC 7231, Section 6.5.9 |
411 |
LENGTH_REQUIRED |
HTTP/1.1 RFC 7231, Section 6.5.10 |
412 |
PRECONDITION_FAILED |
HTTP/1.1 RFC 7232, Section 4.2 |
413 |
REQUEST_ENTITY_TOO_LARGE |
HTTP/1.1 RFC 7231, Section 6.5.11 |
414 |
REQUEST_URI_TOO_LONG |
HTTP/1.1 RFC 7231, Section 6.5.12 |
415 |
UNSUPPORTED_MEDIA_TYPE |
HTTP/1.1 RFC 7231, Section 6.5.13 |
416 |
REQUESTED_RANGE_NOT_SATISFIABLE |
HTTP/1.1 Range Requests RFC 7233, Section 4.4 |
417 |
EXPECTATION_FAILED |
HTTP/1.1 RFC 7231, Section 6.5.14 |
418 |
IM_A_TEAPOT |
HTCPCP/1.0 RFC 2324, Section 2.3.2 |
421 |
MISDIRECTED_REQUEST |
HTTP/2 RFC 7540, Section 9.1.2 |
422 |
UNPROCESSABLE_ENTITY |
WebDAV RFC 4918, Section 11.2 |
423 |
LOCKED |
WebDAV RFC 4918, Section 11.3 |
424 |
FAILED_DEPENDENCY |
WebDAV RFC 4918, Section 11.4 |
425 |
TOO_EARLY |
Using Early Data in HTTP RFC 8470 |
426 |
UPGRADE_REQUIRED |
HTTP/1.1 RFC 7231, Section 6.5.15 |
428 |
PRECONDITION_REQUIRED |
Additional HTTP Status Codes RFC 6585 |
429 |
TOO_MANY_REQUESTS |
Additional HTTP Status Codes RFC 6585 |
431 |
REQUEST_HEADER_FIELDS_TOO_LARGE |
Additional HTTP Status Codes RFC 6585 |
451 |
UNAVAILABLE_FOR_LEGAL_REASONS |
An HTTP Status Code to Report Legal Obstacles RFC 7725 |
500 |
INTERNAL_SERVER_ERROR |
HTTP/1.1 RFC 7231, Section 6.6.1 |
501 |
NOT_IMPLEMENTED |
HTTP/1.1 RFC 7231, Section 6.6.2 |
502 |
BAD_GATEWAY |
HTTP/1.1 RFC 7231, Section 6.6.3 |
503 |
SERVICE_UNAVAILABLE |
HTTP/1.1 RFC 7231, Section 6.6.4 |
504 |
GATEWAY_TIMEOUT |
HTTP/1.1 RFC 7231, Section 6.6.5 |
505 |
HTTP_VERSION_NOT_SUPPORTED |
HTTP/1.1 RFC 7231, Section 6.6.6 |
506 |
VARIANT_ALSO_NEGOTIATES |
Transparent Content Negotiation in HTTP RFC 2295, Section 8.1 (Experimental) |
507 |
INSUFFICIENT_STORAGE |
WebDAV RFC 4918, Section 11.5 |
508 |
LOOP_DETECTED |
WebDAV Binding Extensions RFC 5842, Section 7.2 (Experimental) |
510 |
NOT_EXTENDED |
An HTTP Extension Framework RFC 2774, Section 7 (Experimental) |
511 |
NETWORK_AUTHENTICATION_REQUIRED |
Additional HTTP Status Codes RFC 6585, Section 6 |