HTTP Codes in Testing
As a
Performance tester, I always get to see http code in my response tab. Trust me
, if we know about it , then it becomes easy in debugging. Today in this post, I
will share information on HTTP Codes.
There
are 4 main or board categories in HTTP Codes.
è
1xx-
Informational
è
2xx- Success
è
3xx- Redirection
è
4xx-
Client Error
è
5xx-
Server Error
Now
let’s move to understand about various possible HTTP code along with its meaning
as we received :
è
1xx- Informational
This category
of http code tells us about an interim response for communicating connection
status or request progress prior to completing the requested action and sending
a final response.
These are
codes which come under this category:
100:
Continue
101:
Switching Protocols
102:
Processing
è
2xx- Success
These status
codes indicate that the client’s request was successfully received, understood,
and accepted.
Below are
varieties:
Code
|
Meaning
|
Code
|
Meaning
|
200
|
OK
|
205
|
Reset Content
|
201
|
Created
|
206
|
Partial Content
|
202
|
Accepted
|
207
|
Multi Status
|
203
|
No Authoritative Info
|
208
|
Already Accepted
|
204
|
No Content
|
226
|
IM Used
|
è
3xx- Redirection
The 3xx
(Redirection) class of status code indicates that further action needs to be
taken by the user agent in order to fulfill the request.
Code
|
Meaning
|
Code
|
Meaning
|
300
|
Multiple Choices
|
304
|
Not Modified
|
301
|
Moved Permanently
|
305
|
Use Proxy
|
302
|
Found
|
307
|
Temporary redirect
|
303
|
See Other
|
308
|
Permanent Redirect
|
è
4xx- Client Error
This one
indicates that the client seems to have errored.
This one
is important one so let’s understand the common error we received due to
scripting part/Tool part
400 (Bad Request): indicates that the server cannot or will not
process the request due to something that is perceived to be a client error
(e.g., malformed request syntax).
401 Unauthorized: indicates that the request has not been
applied because it lacks valid authentication credentials for the target
resource.
403 Forbidden: indicates that the server understood the
request but refuses to authorize it.
404 Not Found: indicates that the origin server did not find
a current representation for the target resource or is not willing to disclose
that one exists.
405 Method Not Allowed: indicates that the method received in the
request-line is known by the origin server but not supported by the target
resource.
415 Unsupported Media Type: indicates that the origin server is refusing
to service the request because the payload is in a format not supported by this
method on the target resource. The format problem might be due to the request’s
indicated Content-Type or Content-Encoding, or as a result of inspecting the
data directly.
Code
|
Meaning
|
Code
|
Meaning
|
402
|
Payment Required
|
421
|
Misdirected Request
|
406
|
Not Acceptable
|
422
|
Un-processable Entity
|
407
|
Proxy Authentication Required
|
423
|
Locked
|
408
|
Request Timeout
|
424
|
Failed Dependency
|
409
|
Conflict
|
426
|
Upgrade Required
|
Code
|
Meaning
|
Code
|
Meaning
|
410
|
Gone
|
428
|
Precondition Required
|
411
|
Length Required
|
429
|
Too Many Requests
|
412
|
Precondition Failed
|
431
|
Request Header Fields Too Large
|
413
|
Payload Too Large
|
444
|
Connection Closed Without
Response
|
414
|
Request-URI Too Long
|
451
|
Unavailable For Legal Reasons
|
416
|
Requested Range Not Satisfiable
|
499
|
Client Closed Request
|
417
|
Expectation Failed
|
|
|
418
|
I’m a teapot (RFC)
|
|
|
|
|
|
|
è
5xx- Server Error
Again,
this type http code is very important because this is what we look for. One of
the purposes of testing to uncover these codes and get them fixed by team.
The 5xx
(Server Error) class of status code indicates that the server is aware that it
has erred or is incapable of performing the requested method.
500 Internal Server Error: indicates that the server encountered an
unexpected condition that prevented it from fulfilling the request.
502 Bad Gateway: indicates that the server while acting as a
gateway or proxy, received an invalid response from an inbound server it
accessed while attempting to fulfill the request.
503 Service Unavailable: indicates that the server is currently unable
to handle the request due to a temporary overload or scheduled maintenance,
which will likely be alleviated after some delay.
504 Gateway Timeout: indicates that the server while acting as a
gateway or proxy, did not receive a timely response from an upstream server it
needed to access in order to complete the request
Code
|
Meaning
|
Code
|
Meaning
|
501
|
Not Implemented
|
508
|
Loop Detected
|
505
|
HTTP Version Not Supported
|
510
|
Not Extended
|
506
|
Variant Also Negotiate
|
511
|
Network Authentication Required
|
507
|
Insufficient Storage
|
599
|
Network Connect Timeout Error
|
Hopefully this post would be helpful.
Happy
Testing!!!
Comments
Post a Comment