Status code:

 

Status codes are specific codes.
Which use in response to a browser’s request. These are made to the server. The
Status-Code element is in 3-digit integer form. Where first digit out of three
specifies the standard class of response. And the last two digits do not have
any specialized role. There are mainly five standard classes. Each class and its status code is
described below. Some of them are exampled. Including a description of which method(s)
it can follow and any keep formation required in the response. If the client
does not know the specific status code, it can treat the situation like the
code 00 of the class.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

 

Class 1XX:

This class is known as informational responses. This
class have mainly 4 status code which are 100, 101, 102, and 103.

100
Continue:

Only a
part of the request has been received by the server, but as long as it has not
been rejected, the client should continue with the request

 

101 Switching Protocols:

The server accepts the protocol
that the client suggested in the upgrade header.

 

102 Processing:

The 102 status code is an interim
response. It used to inform the client that the server has accepted the complete
request, but has not completed yet. This status code SHOULD only be sent when
the server has a reasonable expectation that the request will take significant
time to complete.

 

103
Early hints:

Status Code 103 is
an unofficial
implementation. Which still use in very few software source codes. Hence, it
may still appear in rare occasions.
It was planned
to respond when the request was installation dependent, which means it
will appear when something is missingfaulty in the Server installation or
Network. The message “Access denied while
creating Web Service” is for 103.

 

Class 2XX:

The second class 2XX is known as
successful. It contain mainly 200-206 status codes.

This class of status code
represents that the client’s/user’s request is successfully received at server
side. Server also understand and adopted the request.

 

200 ok:

The request from user side was
executed successfully. Example, one requested a webpage which is successfully
displayed.

The request has succeeded. The returned
information is dependent on the method used in the request, for example:

GET an entity corresponding to the
requested resource is sent in the response;

HEAD the entity-header fields
corresponding to the requested resource are sent in the response without any

Message-body;

POST an entity describing or
containing the result of the action;

TRACE an entity containing the
request message as received by the end server.

Figure 1

 

In here post method is used.

Requested URL is displayed with status code 200.

201 created:

The request is complete, and a new resource is created

202 accepted:

The 202
(Accepted) status code indicates that the request has been accepted for
processing, but the processing has not been completed. The request might or
might not eventually be acted upon, as it might be disallowed when processing
actually takes place.  There is no facility
in HTTP for re-sending a status code from an asynchronous operation

 

203 Non-Authoritative Information:

Meta information was changed by the proxy.

204 no content:

The requested operation was executed, but answer is
empty. Because there is no content to show.

Figure 2

 

205 Reset Content:

The browser should clear the form used for this transaction for
additional input

 

206 partial content:

The
server is returning partial data of the size requested. Used in response to
a   request specifying a Range header. The server must specify
the range included in the response with the Content-Range header.

 

Class 3XX:

This class is known as redirection. This class contain
300-308 status codes. It means further action must be taken to complete
the client’s request.

300 multiple choices:

There are many variants for the
resource. The body of the response have information about the variants. The
browser will select itself.

301 Moved Permanently:

If the requested URL of client is moved permanently to new URL in these
case the 301 status code displayed.

Figure 3

Here in this example,

Client request for http://www.amd.com

But this URL has permanently moved to the new URL which is shown in
location at response header. Status code 301 represent it.

The new URL is http://www.amd.com/en

 

302 Found:

The resource was moved to the new
URI temporarily which is given in the Location at response header. 302 means
officially the same as 307, but many browsers interpret it like 303.

 

Let’s see an example,

Figure 4

Here new URL is highlighted.

 

303 see other:

The
requested page is redirected to the new url where we can be found a webpage.

 

 

304 not
modified:

If the client has performed a
method GET request and access is allowed to server, but the document has not
been modified, the server SHOULD respond with this 303 status code.

 

305 use proxy:

The
requested URL must be accessed through the proxy mentioned in the Location
header.

 

306(unused):

This 306
status code was used in a previous version. It is no longer In use, but the
code is reserved.

So we not
able to use as different meaning.

When this
is in use this is known as switch proxy.

 

307 Temporary
Redirect:

This 307 status code is actually means
the same as status code 302. The browser is automatically access a different
URI given in the Location at response header. In contrast to 303, the new URI
must be accessed with the same method as the original request like GET, POST
etc.

 

Let’s see an example,

Figure 5

Here, requested URL http://www.amazon.com is internally redirected to a new URL https://www.amazon.com.

To the secured version of http.

The status code is displayed 307.

 

308 permanently redirected:

It works same as 307 difference is
just that the internal redirection of URL is not temporary but permanently.

 

Class 4XX:

 

This class of status code is means
to be generated if the error comes from the client side. So, class 4XX is known
as client side errors.

In this class there are nearly 20
to 30 status codes.

We are going describe some of them
in here.

 

400 bad request:

Whenever the request is not
understandable by the server then the 400 status code will be generated.

 

401 unauthorized:

Like if the page is password
protected then some of the URL’s are not accessible to all clients then the 401
status code will generate.

 

402 payment required:

This code is reserved for future
use.

 

403 Forbidden:

Access is
forbidden to the requested page.

 

404 Not Found:

The
server cannot find the requested page.

In given
example the requested URL is http://google.com/hello not found so error 404 is
encountered.

Figure 6

 

405 method is not allowed:

The request of method is not
allowed to be applied to this URI.

 

406 Not Acceptable:

The
server can only generate a response that is not accepted by the client.

Like, the browser specified that it
only understands the GIF and JPEG picture formats, but the image exists only in
a PNG version. However, the server may simply deliver a different media type
than requested.

 

407 Proxy
Authentication Required:

If you
want to access some request first you have to authenticate with a proxy server.

 

408 Request Timeout:

The request took longer time than the server was
able to wait.

 

409 conflict:

The request of webpage is not complete
due to conflict resource. The code is only allow in situations where the
request is expected as soon as the client might be able to resolve the conflict
and resubmit the request to the server.

 

410 Gone:

The requested page is no longer available. The
Hypertext Transfer Protocol 410 error
response code indicates that the access to this target resource is not
available at the origin server after long time and that this condition is
likely to be permanent.

 

411 Length
Required:

A Content-Length
of request header is required for this request to server otherwise the error
411 will be encountered.

 

412
Precondition Failed:

The
precondition given in the request from client side is evaluated to false by the
server.

 

413 request entity too large:

The server is declining to
development a request of client because the request entity is larger than the
server is able to process/understand.

 

414 Request
URL Too Large:

If you
want to try to generate this error request a webpage with very long string
length like in thousands after this URL http://www.google.com/ and you will get this 414 error
as shown below. 

Figure 7

 

 

415 Unsupported
Media Type:

The server will not accept the request, because the
media type is not supported. 

 

416
Requested Range Not Satisfiable:

The
requested byte range is not available and is out of bounds.

 

417 Expectation Failed:

The given Expect request-header
field could not be met by this server. If the server is a proxy, the server has
unmistakable evidence that the request could not be met by the next-hop server.

 

418 I’m a teapot:

This status code
is one of the IETF April
Fools’ jokes. This is known as Hyper Text
Coffee Pot Control Protocol, and meant to implement to actual
HTTP servers.

You can check it
out at http://www.google.com/teapot
and don’t forget its working tap on teapot and enjoy.

Figure 8

 

Class 5XX:

 

This is class is final class of
http and known as server errors class. Response of this class status codes
start with the digit “5”. This indicates that the server is aware about the
error will be generated or it’s also right the server is not able to satisfy
the request.

 

500
Internal
Server Error:

The
request was like to be completed but server is not able to understand is
complete /legal or not.

 

501 Not
Implemented:

The server does not have the
functionality which is need to complete the request of client. This is right
response when the server does not recognize the request method.

 

502 bad gateway:

This status code will generate if
the original server response inappropriately to the proxy server.

 

503 service unavailable:

If the server is overloaded or
currently not available the functionality because of maintenance work or any
other then this error get generated.

Here the request to the kitorrent
server is not available so the status code 503 is appear.

Figure 9

 

504
Gateway Timeout:

The
gateway has timed out.

 

505 HTTP
Version Not Supported:

The
server does not support the “http protocol” version or refuse to
support.