HTTP Methods and Status Codes |
HTTP Methods
HTTP Methods are nothing but a series of commands - for the client to prompt the server to take action.
Methods are always specified in upper case letters.
The most common types of HTTP Methods being used are :
GET
- Requests that server retrieves the resource specified by the URL.
- If the URL specified is correct, then the server will send back an appropriate response to the client.
- If the request, for some reason, doesn't proceed properly then an error message may result.
HEAD
- Similar to GET, but, tells the server to not send the actual body of the message.
- Used by the client to check the existence, status or size of a file before proceeding.
POST
- Allows the client to send an entity containing arbitrary data to the server for processing.
- Enables a client to submit information such as an interactive HTML form to a program on the server.
Other less common HTTP Methods :
- OPTIONS: Displays all the HTTP Methods supported by the webserver.
- PUT: For putting objects on the webserver.
- UPDATE: For updating already existing objects on the server.
- DELETE: For deleting objects on the server.
- TRACE: For analyzing the hops being taken on the network.
HTTP Status Codes
HTTP status lines contains both numeric status code and a text phrase
HTTP Status Codes |
The general form of an HTTP status code is "xyy", where the first digit "x", is specified as -
Format | Meaning |
---|---|
1yy | Informational Message |
2yy | Success |
3yy | Redirection |
4yy | Client Error |
5yy | Server Error |
The following is the list of Top 10 HTTP status codes :
Status Code | Meaning |
---|---|
200 | OK |
201 | Created |
204 | No Content |
304 | Not Modified |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Conflict |
500 | Internal Server Error |