HTTP protocol – Status codes – Request and response format – Methods
HTTP protocol
- It is application layer protocol used to communicate between client (e.g. web browser) and HTTP server
- HTTP protocol follows Client server model
HTTP methods
- get
- post
- head
- put
- delete
- connect
- options
- trace
- patch
Sample request message
- A request line (e.g. GET /abc.html HTTP/1.1)
- Request header fields (e.g., Cache-Control: no-cache)
- An empty line
- An optional message body
Sample response message
- status line (e.g. HTTP/1.1 200 OK).
- Response header fields (e.g. WWW-Authenticate: Basic)
- An empty line
- An optional message body
HTTP status codes
Status codes can be divided into 5 types as mentioned below
- Informational 1XX e.g. 100 continue
- Successful 2XX e.g. 200 OK
- Redirection 3XX e.g. 301 moved permanently
- Client Error 4XX e.g. 404 resource not found, 400 bad request
- Server Error 5XX e.g. 500 internal server error
HTTP vs HTTPS
Difference between HTTP and HTTPS is that HTTPS uses certificate and communication is encrypted between client and server.
Recent Comments