What are the status codes of ajax requests?
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!

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



Introduction to HTTP 525 status code: Understand its definition and usage HTTP (HypertextTransferProtocol) 525 status code means that an error occurred on the server during the SSL handshake, resulting in the inability to establish a secure connection. The server returns this status code when an error occurs during the Transport Layer Security (TLS) handshake. This status code falls into the server error category and usually indicates a server configuration or setup problem. When the client tries to connect to the server via HTTPS, the server has no

Title: Methods and code examples to resolve 403 errors in jQuery AJAX requests. The 403 error refers to a request that the server prohibits access to a resource. This error usually occurs because the request lacks permissions or is rejected by the server. When making jQueryAJAX requests, you sometimes encounter this situation. This article will introduce how to solve this problem and provide code examples. Solution: Check permissions: First ensure that the requested URL address is correct and verify that you have sufficient permissions to access the resource.

Understand the meaning of HTTP 301 status code: common application scenarios of web page redirection. With the rapid development of the Internet, people's requirements for web page interaction are becoming higher and higher. In the field of web design, web page redirection is a common and important technology, implemented through the HTTP 301 status code. This article will explore the meaning of HTTP 301 status code and common application scenarios in web page redirection. HTTP301 status code refers to permanent redirect (PermanentRedirect). When the server receives the client's

jQuery is a popular JavaScript library used to simplify client-side development. AJAX is a technology that sends asynchronous requests and interacts with the server without reloading the entire web page. However, when using jQuery to make AJAX requests, you sometimes encounter 403 errors. 403 errors are usually server-denied access errors, possibly due to security policy or permission issues. In this article, we will discuss how to resolve jQueryAJAX request encountering 403 error

Build an autocomplete suggestion engine using PHP and Ajax: Server-side script: handles Ajax requests and returns suggestions (autocomplete.php). Client script: Send Ajax request and display suggestions (autocomplete.js). Practical case: Include script in HTML page and specify search-input element identifier.

How to solve the problem of jQueryAJAX error 403? When developing web applications, jQuery is often used to send asynchronous requests. However, sometimes you may encounter error code 403 when using jQueryAJAX, indicating that access is forbidden by the server. This is usually caused by server-side security settings, but there are ways to work around it. This article will introduce how to solve the problem of jQueryAJAX error 403 and provide specific code examples. 1. to make

Using Ajax to obtain variables from PHP methods is a common scenario in web development. Through Ajax, the page can be dynamically obtained without refreshing the data. In this article, we will introduce how to use Ajax to get variables from PHP methods, and provide specific code examples. First, we need to write a PHP file to handle the Ajax request and return the required variables. Here is sample code for a simple PHP file getData.php:

Interpreting HTTP Status Code 301: How to Correctly Handle Permanent Redirect Errors HTTP status codes are a very important part of web applications. They provide information to the client about the processing status of the request. The 301 status code is a special status code that indicates that the requested resource has been permanently moved to a new location. In this article, we will interpret the 301 status code and discuss how to properly handle permanent redirect errors. 1. Understand the 301 status code. When the server receives a request from the client, if the requested resource has been
