HTTP

Hyper Text Transfer Protocol

HTTP is a protocol for transmitting resouces such as HTML.

It follows a client-server model where a client (such as a web browser) opens a connection with a web server and makes a request for a resource (such as the homepage/index.html) and then waits for a response from the server.

Request/Response Cycle

HTTP Message Format

In HTTP/1.1, the client and server communicate via plain text using a similar format:

Request Message

Response Message

HTTP Methods

HTTP Methods describe the operation the client wants the server to do. Common methods include GET, POST, PUT, PATCH, and DELETE.

The GET method is used to fetch (read) data from the server. More on the other methods and their uses on MDN and in future classes.

HTTP Status Codes

HTTP response status codes indicate if an HTTP request has successfully completed or not. Status codes are grouped in five ranges:

Range
Purpose

100-199

Informational

200-299

Success

300-399

Redirect

400-499

Client Error

500-599

Server Error

Further Reading

https://developer.mozilla.org/en-US/docs/Web/HTTP/

Last updated

Was this helpful?