Common HTTP status Code

Source: Internet
Author: User

<summary>
		///The server request succeeded
		///</summary>
		///<returns><c>true</c> if is exist the specified URI; Otherwise, <c>false</c>.</returns>
		///<param name= "uri" >URI.</param>
		public static bool Isexist (string uri)
		{
			try 
			{
				using (HttpWebRequest req = (HttpWebRequest) WebRequest.Create (URI)) 
				{
					req. method = ' head ';
					Req. Timeout = 1000;
					HttpWebResponse res = (HttpWebResponse) req. GetResponse ();
					Return (Res. StatusCode = = Httpstatuscode.ok);
				}
			Catch 
			{return
				false;
			}
		}





Common HTTP status Code

Common Status Codes:

http:status200– Server successfully returned Web page

The page requested by http:status404– does not exist

http:status503– Service is not available

————————————————————————————————

Http:status 1xx (Temporary response)

-> A status code that represents a temporary response and requires the requester to continue to perform the operation.

Detailed Code and Description:

Http:status 100 (continued)

The-> requester should continue to make the request. The server returns this code indicating that the first part of the request has been received and is waiting for the remainder.

Http:status 101 (Switching protocol)

The-> requestor has asked the server to switch protocols and the server has confirmed and is ready to switch.

——————————————————————————————————

HTTP Status 2xx (successful)

-> indicates that the requested status code was successfully processed;

HTTP Status 200 (successful)

The-> server has successfully processed the request. Typically, this indicates that the server has provided the requested Web page.

HTTP Status 201 (created)

The-> request was successful and the server created a new resource.

HTTP Status 202 (accepted)

The-> server has accepted the request but has not yet processed it.

HTTP Status 203 (non-licensing information)

The-> server has successfully processed the request, but the returned information may be from another source.

HTTP Status 204 (no content)

The-> server successfully processed the request but did not return any content.

HTTP Status 205 (Reset content)

The-> server successfully processed the request but did not return any content.

HTTP Status 206 (partial content)

The-> server successfully processed a partial GET request.

HTTP Status 3xx (redirect)

-> This completes the request and requires further action. Typically, these status codes are used for redirection.

——————————————————————————————————

HTTP Status 300 (multiple selections)

-> for requests, the server performs a variety of operations. The server can select an action based on the requester (user agent) or provide an action list for the requester to choose from.

HTTP Status 301 (permanently moved)

The-> requested page has been permanently moved to the new location. When the server returns this response (a response to a GET or head request), the requestor is automatically transferred to the new location. You should use this code to tell Googlebot that a Web page or Web site has been permanently moved to a new location.

HTTP Status 302 (Temporary Move)

The-> server currently responds 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, like the 301 code in response to a get and head request, automatically moves the requester to a different location, but you should not use this code to tell Googlebot that a Web page or Web site has moved because Googlebot will continue to crawl the original location and index it.

HTTP Status 303 (see other locations)

The server returns this code when the-> requester should use a separate GET request to retrieve the response for a different location. For all requests except the head, the server automatically transfers to a different location.

HTTP Status 304 (not modified)

-> The requested page has not been modified since the last request. When the server returns this response, the content of the Web page is not returned. If the Web page has not changed since the last request from the requestor, you should configure the server to return this response (called the If-modified-since HTTP header). The server can tell Googlebot that the page has not changed since the last crawl, thus saving bandwidth and overhead.

HTTP Status 305 (using a proxy)

The-> requester can only use the proxy to access the requested Web page. If the server returns this response, it also indicates that the requester should use the proxy.

HTTP Status 307 (using a proxy)

The-> server currently responds 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, similar to the <a href=answer.py?answer=>301</a> code that responds to get and head requests, automatically moves the requester to a different location, but you should not use this code to tell Googlebot A page or Web site has moved because Googlebot will continue to crawl and index the original location.

————————————————————————————————————

HTTP Status 4xx (Request error)

-> These status codes indicate a possible error in the request, which prevents the server from processing.

Detailed Code Description:

HTTP Status 400 (Error request)

The-> server does not understand the syntax of the request.

HTTP Status 401 (not authorized)

The-> request requires authentication. The server may return this response for Web pages that need to log on.

HTTP Status 403 (Forbidden)

The-> server rejected the request.

HTTP Status 404 (Not Found)

The-> server could not find the requested Web page.

HTTP Status 405 (method Disabled)

-> disables the method specified in the request.

HTTP Status 406 (not accepted)

-> cannot use the requested content attribute to respond to the requested Web page.

HTTP Status 407 (requires proxy authorization)

-> This status code is similar to 401 (not authorized), but the specified requester should authorize the use of the agent.

HTTP Status 408 (Request timed out)

Timeout occurred while waiting for a request on the-> server.

HTTP Status 409 (conflict)

The-> server encountered a conflict while completing the request. The server must contain information about the conflict in the response.

HTTP Status 410 (Deleted)

-> The server returns this response if the requested resource has been permanently deleted.

HTTP Status 411 (requires a valid length)

The-> server does not accept requests that do not contain a valid content Length header field.

HTTP Status 412 (Prerequisites not met)

The-> server did not meet one of the prerequisites that the requestor set in the request.

HTTP Status 413 (Request entity too Large)

The-> server was unable to process the request because the request entity was too large to handle the server.

HTTP Status 414 (The requested URI is too long) requests a URI (usually a URL) that is too long for the server to process.

HTTP Status 415 (Unsupported media type)

The format of the-> request is not supported by the requested page.

HTTP Status 416 (Request scope does not meet requirements)

-> if the page cannot provide the requested range, the server returns this status code.

HTTP Status 417 (expectations not met)

The-> server did not meet the requirements for the "expect" Request header field.

———————————————————————————————————

HTTP Status 5xx (server error)

-> These status codes indicate that the server encountered an internal error while trying to process the request. These errors may be errors on the server itself, not the request.

Code Detail and Description:

HTTP Status 500 (server internal error)

The-> server encountered an error and could not complete the request.

HTTP Status 501 (not yet implemented)

The-> server does not have the capability to complete the request. For example, this code may be returned when the server does not recognize the request method.

HTTP Status 502 (Error Gateway)

The-> server, as a gateway or proxy, receives an invalid response from the upstream server.

HTTP Status 503 (Service Unavailable)

The-> server is not currently available (due to overloading or downtime maintenance). Usually, this is only a temporary state.

HTTP Status 504 (Gateway Timeout)

The-> server acts as a gateway or proxy, but does not receive requests from upstream servers in a timely manner.

HTTP Status 505 (HTTP version not supported)

The HTTP protocol version used in the request is not supported by the-> server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.