The status codes of ajax requests are: 100 (continue), 101 (switch protocol), 200 (success), 201 (created), 205 (reset content), 301 (permanently moved), 400 ( Bad request), 401 (Unauthorized), 403 (Forbidden), 500 (Internal server error), 502 (Bad gateway), etc.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
Detailed explanation of all status codes for ajax requests
1XX (temporary response):
representation A status code that responds temporarily and requires the requester to continue performing the operation;
100 (Continue): The requester should continue to make the request. The server returns this code to indicate that it has received the first part of the request and is waiting for the other parts;
101 (switching protocol): Requesting this request to switch protocol, the server has confirmed and is actually switched;
2XX (Success):
Status code indicating that the request was successfully processed;
200 (Success): The server has successfully processed the request. Typically, this means that the server served the requested web page. If this status code appears for your robots.txt file, it means that Googlebot successfully retrieved the file.
201 (Created): The request was successful and the server created a new resource.
202 (Accepted); The server has accepted the request but has not yet processed it.
203 (Unauthorized information): The server successfully processed the request, but the returned information may have come from another source.
204 (No Content): The server successfully processed the request but did not return any content.
205 (Reset Content): The server successfully processed the request, but did not return any content. Unlike the 204 response, this response requires the requester to reset the document view (for example, clear the form contents to enter new content).
206 (partial content): The server successfully processed part of the GET request.
3xx (Redirect)
Further action is required to complete the request. Typically, these status codes are used for redirects. Google recommends that you use no more than 5 redirects per request. You can use Webmaster Tools to see if Googlebot is having trouble crawling the redirected page. The Web Crawl page under Diagnostics lists URLs that Googlebot was unable to crawl due to redirect errors.
300 (Multiple Choices): In response to the request, the server can perform a variety of operations. The server can select an action based on the requester (user agent) or provide a list of actions for the requester to choose from.
301 (Permanently Moved): The requested web page has been permanently moved to a new location. When the server returns this response (in response to a GET or HEAD request), it automatically forwards the requester to the new location. You should use this code to tell Googlebot that a page or website has been permanently moved to a new location.
302 (Temporary Move): The server is currently responding to requests from a web page in a different location, but the requester should continue to use the original location to respond to future requests. This code is similar to the 301 code that responds to get and head requests. It will automatically redirect the requester to a different location. However, this code should not be used to tell Googlebot that a web page or website has moved, because Googlebot will continue to crawl the original location. and indexed.
303 (View Other Locations): The server returns this code when the requester should use separate get requests to different locations to retrieve the response. For all requests outside the head, the server will automatically go to other locations;
304 (Unmodified): The requested web page has not been modified since the last request. When the server returns this response, no web page content is returned; the server should be configured to return this response (called the if-modified-Since HTTP header) if the web page has not changed since the requester's last request. The server can tell googlebot that the page has not changed since the last time it was crawled, thereby saving bandwidth and overhead.
305 (Using Proxy): The requester can only use a proxy to access the requested web page. If the server returns this response, it also indicates that the requester should use a proxy.
307 (Temporary Redirect): The server is currently responding to requests from web pages in different locations, but the requester should continue to use the original location to respond to future requests. This code is consistent with the response to get and head requests. href="">The code is similar and will automatically redirect the requester to a different location, but it should not tell googlebot that a page or website has moved, because googlebot will continue to crawl and index the original location .
4xx (Request Error)
These status codes indicate that the request may be in error, preventing the server from processing
400 (Bad Request): The server does not Understand the syntax of the request;
401 (Unauthorized): The request requires authentication; for pages requested after logging in, the server may return a response;
403 (Forbidden): The server refused the request. If you see this status code when Googlebot tries to crawl a valid page on your site (you can see this on the Web Crawl page under Google Webmaster Tools Diagnostics), it's possible that the server's host has denied Googlebot access;
404 (Not Found):
405 (Method Disabled): Disable the method specified in the request;
406 (Not Accepted): Unable to respond to the request using the request content characteristics Web page;
407 (Proxy authorization required): This status code is similar to 401 (Unauthorized), but specifies that the requester should authorize Use a proxy. If the server returns this response, it also indicates that the requester should use a proxy;
408 (Request Timeout): A timeout occurs while the server is waiting for the request;
409 (Conflict): Occurs when the server completes the request conflict. The server MUST include information about the conflict in the response. The server may return this code when responding to a PUT request that conflicts with a previous request, along with a list of differences between the two requests;
410 (Deleted): If the requested resource has been permanently deleted, the server will Return this response. This code is similar to the 404 (Not Found) code, but is sometimes used in place of the 404 code when the resource previously existed but now does not. If the resource has been moved permanently, you should use 301 to specify the new location of the resource;
411 (valid length required): The server does not accept requests without a valid content-length header field;
412 (Precondition not met): The server does not meet one of the preconditions set by the requester in the request;
413 (Request entity is too large): The server cannot process the request because the request entity is too large and exceeds the server's size. Processing capability;
414 (requested url too long): The requested URI (usually a URL) is too long and the server cannot handle it;
415 (unsupported media type) : The requested format is not supported by the requested page;
416 (The requested range does not meet the requirements): If the page cannot provide the requested range, the server will return this status code;
417 ( Expectations not met): The server did not meet the requirements for the "Expectations" request header field;
5XX (Server Error)
These status codes indicate that an internal error occurred while the server was processing the request. These errors may be errors on the server itself, rather than request errors;
500 (server internal error): The server encountered an error and was unable to complete the request;
501 (not yet implemented): The server did not Have the function to complete the request. For example, this code may be returned when the server does not recognize the request method;
502 (Bad Gateway): The server, acting as a gateway or proxy, received an invalid response from the upstream server;
503 (Server Unavailable) Used): The server is currently unavailable (due to overload or downtime for maintenance). Usually, this is only a temporary state
504 (Gateway Timeout): The server acts as a gateway or proxy, but the request is not received from the upstream server in time;
505 (http version is not supported): Server The HTTP protocol version used in the request is not supported
[Related tutorial recommendations: AJAX video tutorial]
The above is the detailed content of What are the status codes of ajax requests?. For more information, please follow other related articles on the PHP Chinese website!

Scrapy是一个开源的Python爬虫框架,它可以快速高效地从网站上获取数据。然而,很多网站采用了Ajax异步加载技术,使得Scrapy无法直接获取数据。本文将介绍基于Ajax异步加载的Scrapy实现方法。一、Ajax异步加载原理Ajax异步加载:在传统的页面加载方式中,浏览器发送请求到服务器后,必须等待服务器返回响应并将页面全部加载完毕才能进行下一步操

作为一种基于MVC模式的PHP框架,CakePHP已成为许多Web开发人员的首选。它的结构简单,易于扩展,而其中的AJAX技术更是让开发变得更加高效。在本文中,将介绍如何使用CakePHP中的AJAX。什么是AJAX?在介绍如何在CakePHP中使用AJAX之前,我们先来了解一下什么是AJAX。AJAX是“异步JavaScript和XML”的缩写,是指一种在

jquery ajax报错403是因为前端和服务器的域名不同而触发了防盗链机制,其解决办法:1、打开相应的代码文件;2、通过“public CorsFilter corsFilter() {...}”方法设置允许的域即可。

ajax传递中文乱码的解决办法:1、设置统一的编码方式;2、服务器端编码;3、客户端解码;4、设置HTTP响应头;5、使用JSON格式。详细介绍:1、设置统一的编码方式,确保服务器端和客户端使用相同的编码方式,通常情况下,UTF-8是一种常用的编码方式,因为它可以支持多种语言和字符集;2、服务器端编码,在服务器端,确保将中文数据以正确的编码方式进行编码,再传递给客户端等等。

404页面基础配置404错误是www网站访问容易出现的错误。最常见的出错提示:404notfound。404错误页的设置对网站seo有很大的影响,而设置不当,比如直接转跳主页等,会被搜索引擎降权拔毛。404页面的目的应该是告诉用户:你所请求的页面是不存在的,同时引导用户浏览网站其他页面而不是关掉窗口离去。搜索引擎通过http状态码来识别网页的状态。当搜索引擎获得了一个错误链接时,网站应该返回404状态码,告诉搜索引擎放弃对该链接的索引。而如果返回200或302状态码,搜索引擎就会为该链接建立索引

ajax重构指的是在不改变软件现有功能的基础上,通过调整程序代码改善软件的质量、性能,使其程序的设计模式和架构更合理,提高软件的扩展性和维护性;Ajax的实现主要依赖于XMLHttpRequest对象,由于该对象的实例在处理事件完成后就会被销毁,所以在需要调用它的时候就要重新构建。

CSRF代表跨站请求伪造。CSRF是未经授权的用户冒充授权执行的恶意活动。Laravel通过为每个活动用户会话生成csrf令牌来保护此类恶意活动。令牌存储在用户的会话中。如果会话发生变化,它总是会重新生成,因此每个会话都会验证令牌,以确保授权用户正在执行任何任务。以下是访问csrf_token的示例。生成csrf令牌您可以通过两种方式获取令牌。通过使用$request→session()→token()直接使用csrf_token()方法示例<?phpnamespaceApp\Http\C

当提交表单时,捕获提交过程并尝试运行以下代码片段来上传文件-//File1varmyFile=document.getElementById('fileBox').files[0];varreader=newFileReader();reader.readAsText(file,'UTF-8');reader.onload=myFunc;functionmyFunc(event){ varres


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
