Http status code

本文详细介绍了HTTP协议中各种状态码的含义及应用场景,包括成功、重定向、客户端错误及服务器错误等不同类别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 
1**:请求收到,继续处理
2**:操作成功收到,分析、接受
3**:完成此请求必须进一步处理
4**:请求包含一个错误语法或不能完成
5**:服务器执行一个完全有效请求失败
100——客户必须继续发出请求
101——客户要求服务器根据请求转换HTTP协议版本
200——交易成功
201——提示知道新文件的URL
202——接受和处理、但处理未完成
203——返回信息不确定或不完整
204——请求收到,但返回信息为空
205——服务器完成了请求,用户代理必须复位当前已经浏览过的文件
206——服务器已经完成了部分用户的GET请求
300——请求的资源可在多处得到
301——删除请求数据
302——在其他地址发现了请求数据
303——建议客户访问其他URL或访问方式
304——客户端已经执行了GET,但文件未变化
305——请求的资源必须从服务器指定的地址得到
306——前一版本HTTP中使用的代码,现行版本中不再使用
307——申明请求的资源临时性删除
400——错误请求,如语法错误
401——请求授权失败
402——保留有效ChargeTo头响应
403——请求不允许
404——没有发现文件、查询或URl
405——用户在Request-Line字段定义的方法不允许
406——根据用户发送的Accept拖,请求资源不可访问
407——类似401,用户必须首先在代理服务器上得到授权
408——客户端没有在用户指定的饿时间内完成请求
409——对当前资源状态,请求不能完成
410——服务器上不再有此资源且无进一步的参考地址
411——服务器拒绝用户定义的Content-Length属性请求
412——一个或多个请求头字段在当前请求中错误
413——请求的资源大于服务器允许的大小
414——请求的资源URL长于服务器允许的长度
415——请求资源不支持请求项目格式
416——请求中包含Range请求头字段,在当前请求资源范围内没有range指示值,请求
也不包含If-Range请求头字段
417——服务器不满足请求Expect头字段指定的期望值,如果是代理服务器,可能是下
一级服务器不能满足请求
500——服务器产生内部错误
501——服务器不支持请求的函数
502——服务器暂时不可用,有时是为了防止发生系统过载
503——服务器过载或暂停维修
504——关口过载,服务器使用另一个关口或服务来响应用户,等待时间设定值较长
505——服务器不支持或拒绝支请求头中指定的HTTP版本
==========================================================
英文版:
100:Continue
101:Switching Protocols
102:Processing
200:OK
201:Created
202:Accepted
203:Non-Authoriative Information
204:No Content
205:Reset Content
206:Partial Content
207:Multi-Status
300:Multiple Choices
301:Moved Permanently
302:Found
303:See Other
304:Not Modified
305:Use Proxy
306:(Unused)
307:Temporary Redirect
400:Bad Request
401:Unauthorized
402:Payment Granted
403:Forbidden
404:File Not Found
405:Method Not Allowed
406:Not Acceptable
407:Proxy Authentication Required
408:Request Time-out
409:Conflict
410:Gone
411:Length Required
412:Precondition Failed
413:Request Entity Too Large
414:Request-URI Too Large
415:Unsupported Media Type
416:Requested range not satisfiable
417:Expectation Failed
422:Unprocessable Entity
423:Locked
424:Failed Dependency
500:Internal Server Error
501:Not Implemented
502:Bad Gateway
503:Service Unavailable
504:Gateway Timeout
505:HTTP Version Not Supported
507:Insufficient Storage

CONSTANT    CONTINUE = 100                  ! Continue
CONSTANT    SWITCH_PROTOCOLS = 101          ! Switching Protocols
CONSTANT    OK = 200                        ! OK
CONSTANT    CREATED = 201                   ! Created
CONSTANT    ACCEPTED = 202                  ! Accepted
CONSTANT    NON_AUTH_INFO = 203             ! Non-Authoritative Information
CONSTANT    NO_CONTENT = 204                ! No Content
CONSTANT    RESET_CONTENT = 205             ! Reset Content
CONSTANT    PARTIAL_CONTENT = 206           ! Partial Content
CONSTANT    MULTIPLE_CHOICES = 300          ! Multiple Choices
CONSTANT    MOVED = 301                     ! Moved Permanently
CONSTANT    FOUND = 302                     ! Found
CONSTANT    SEE_OTHER = 303                 ! See Other
CONSTANT    NOT_MODIFIED = 304              ! Not Modified
CONSTANT    USE_PROXY = 305                 ! Use Proxy
CONSTANT    TEMPORARY = 307                 ! Temporary Redirect
CONSTANT    BAD_REQ = 400                   ! Bad Request
CONSTANT    UNAUTHORIZED = 401              ! Unauthorized
CONSTANT    PAYMENT_REQ = 402               ! Payment Required
CONSTANT    FORBIDDEN = 403                 ! Forbidden
CONSTANT    NOT_FOUND = 404                 ! Not Found
CONSTANT    NOT_ALLOWED = 405               ! Method Not Allowed
CONSTANT    NOT_ACCEPTABLE = 406            ! Not Acceptable
CONSTANT    PROXY_AUTH_REQ = 407            ! Proxy Authentication Required
CONSTANT    REQ_TIMEOUT = 408               ! Request Time-out
CONSTANT    CONFLICT = 409                  ! Conflict
CONSTANT    GONE = 410                      ! Gone
CONSTANT    LENGTH_REQ = 411                ! Length Required
CONSTANT    PRECOND_FAILED = 412            ! Precondition Failed
CONSTANT    REQ_ENTITY_2BIG = 413           ! Request Entity Too Large
CONSTANT    REQ_URI_2BIG = 414              ! Request-URI Too Large
CONSTANT    UNSUP_MEDIA = 415               ! Unsupported Media Type 
CONSTANT    OUT_OF_RANGE = 416              ! Requested range not satisfied
CONSTANT    EXPECT_FAILED = 417             ! Expectation Failed
CONSTANT    SERVER_ERROR = 500              ! Internal Server Error
CONSTANT    NOT_IMPLEMENTED = 501           ! Not Implemented
CONSTANT    BAD_GATEWAY = 502               ! Bad Gateway
CONSTANT    NO_SERVICE = 503                ! Service Unavailable
CONSTANT    GATEWAY_TIMEOUT = 504           ! Gateway Time-out
CONSTANT    UNSUP_HTTP_VER = 505            ! HTTP Version not supported

CONSTANT    REQ_SUCCEEDED = 1               ! Successful statement
CONSTANT    REQ_HTTP_CODE = 0               ! HTTP request succeeded.
CONSTANT    REQ_GENERIC_ERR = -1            ! Generic Error
CONSTANT    REQ_SOCKET_ERR = -2             ! Socket Error

raise KeyError(f"{self.__class__.__name__} does not support field: {key}") KeyError: 'NepuContentItem does not support field: publish_date' 2025-07-07 20:46:23 [nepudata] INFO: 开始解析页面: https://www.nepu.edu.cn/gjjl/xjjl.htm 2025-07-07 20:46:23 [scrapy.core.scraper] ERROR: Spider error processing <GET https://www.nepu.edu.cn/gjjl/xjjl.htm> (referer: None) Traceback (most recent call last): File "D:\annaCONDA\Lib\site-packages\scrapy\utils\defer.py", line 257, in iter_errback yield next(it) ^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\utils\python.py", line 312, in __next__ return next(self.data) ^^^^^^^^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\utils\python.py", line 312, in __next__ return next(self.data) ^^^^^^^^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "D:\annaCONDA\Lib\site-packages\scrapy\spidermiddlewares\offsite.py", line 28, in <genexpr> return (r for r in result or () if self._filter(r, spider)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "D:\annaCONDA\Lib\site-packages\scrapy\spidermiddlewares\referer.py", line 353, in <genexpr> return (self._set_referer(r, response) for r in result or ()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "D:\annaCONDA\Lib\site-packages\scrapy\spidermiddlewares\urllength.py", line 27, in <genexpr> return (r for r in result or () if self._filter(r, spider)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "D:\annaCONDA\Lib\site-packages\scrapy\spidermiddlewares\depth.py", line 31, in <genexpr> return (r for r in result or () if self._filter(r, response, spider)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\core\spidermw.py", line 104, in process_sync for r in iterable: File "C:\Users\Lenovo\nepu_spider\nepu_spider\spiders\nepudata_spider.py", line 93, in parse item = self.extract_content(response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lenovo\nepu_spider\nepu_spider\spiders\nepudata_spider.py", line 175, in extract_content item['publish_date'] = publish_date ~~~~^^^^^^^^^^^^^^^^ File "D:\annaCONDA\Lib\site-packages\scrapy\item.py", line 85, in __setitem__ raise KeyError(f"{self.__class__.__name__} does not support field: {key}") KeyError: 'NepuContentItem does not support field: publish_date' 2025-07-07 20:46:23 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/yjsy/>: HTTP status code is not handled or not allowed 2025-07-07 20:46:24 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/jwc/>: HTTP status code is not handled or not allowed 2025-07-07 20:46:24 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xsc/>: HTTP status code is not handled or not allowed 2025-07-07 20:46:25 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/rsc/>: HTTP status code is not handled or not allowed 2025-07-07 20:46:26 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/kyc/>: HTTP status code is not handled or not allowed 2025-07-07 20:46:26 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xxyw/?year=2020>: HTTP status code is not handled or not allowed 2025-07-07 20:46:27 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xxyw/?year=2021>: HTTP status code is not handled or not allowed 2025-07-07 20:46:28 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xxyw/?year=2022>: HTTP status code is not handled or not allowed 2025-07-07 20:46:28 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xxyw/?year=2023>: HTTP status code is not handled or not allowed 2025-07-07 20:46:29 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xxyw/?year=2024>: HTTP status code is not handled or not allowed 2025-07-07 20:46:29 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xxyw/?year=2025>: HTTP status code is not handled or not allowed 2025-07-07 20:46:30 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/tzgg/?year=2020>: HTTP status code is not handled or not allowed 2025-07-07 20:46:30 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/tzgg/?year=2021>: HTTP status code is not handled or not allowed 2025-07-07 20:46:31 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/tzgg/?year=2022>: HTTP status code is not handled or not allowed 2025-07-07 20:46:31 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/tzgg/?year=2023>: HTTP status code is not handled or not allowed 2025-07-07 20:46:32 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/tzgg/?year=2024>: HTTP status code is not handled or not allowed 2025-07-07 20:46:32 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/tzgg/?year=2025>: HTTP status code is not handled or not allowed 2025-07-07 20:46:33 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xsdt/?year=2020>: HTTP status code is not handled or not allowed 2025-07-07 20:46:34 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xsdt/?year=2021>: HTTP status code is not handled or not allowed 2025-07-07 20:46:34 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xsdt/?year=2022>: HTTP status code is not handled or not allowed 2025-07-07 20:46:35 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xsdt/?year=2023>: HTTP status code is not handled or not allowed 2025-07-07 20:46:36 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xsdt/?year=2024>: HTTP status code is not handled or not allowed 2025-07-07 20:46:37 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <404 https://www.nepu.edu.cn/xsdt/?year=2025>: HTTP status code is not handled or not allowed 2025-07-07 20:46:37 [scrapy.core.engine] INFO: Closing spider (finished) 2025-07-07 20:46:37 [nepudata] INFO: 数据库连接已关闭 2025-07-07 20:46:37 [scrapy.statscollectors] INFO: Dumping Scrapy stats: {'downloader/request_bytes': 10178, 'downloader/request_count': 32, 'downloader/request_method_count/GET': 32, 'downloader/response_bytes': 117980, 'downloader/response_count': 32, 'downloader/response_status_count/200': 9, 'downloader/response_status_count/404': 23, 'elapsed_time_seconds': 23.999904, 'finish_reason': 'finished', 'finish_time': datetime.datetime(2025, 7, 7, 12, 46, 37, 62452), 'httpcompression/response_bytes': 187569, 'httpcompression/response_count': 9, 'httperror/response_ignored_count': 23, 'httperror/response_ignored_status_count/404': 23, 'log_count/ERROR': 9, 'log_count/INFO': 45, 'log_count/WARNING': 1, 'response_received_count': 32, 'scheduler/dequeued': 32, 'scheduler/dequeued/memory': 32, 'scheduler/enqueued': 32, 'scheduler/enqueued/memory': 32, 'spider_exceptions/KeyError': 9, 'start_time': datetime.datetime(2025, 7, 7, 12, 46, 13, 62548)} 2025-07-07 20:46:37 [scrapy.core.engine] INFO: Spider closed (finished)
最新发布
07-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值