HTTP stands for Hypertext Transfer Protocol, and it is used for communication between browsers, servers, and applications.
Here are the components of HTTP:
MIME(Multipurpose Internet Mail Extensions)
MIME is used to distinguish between different data types on the internet, as it deals with a wide variety of data types.
URI(Uniform Resource Identifier)
- It allows us to specify the location of a resource.
- For example, "http://www.naver.com/image.gif" means "go to naver.com and get image.gif using the HTTP"
- url(uniform resource location): It specifies specific location of a resource.
- urn(uniform resource name): It specifies specific name of a resouce regardless of location.
Most of URIs are URLs .
Transaction
- It consists of a request (from the web browser to the server) and a response (from the server to the web browser).
- "Status codes" are used for communication.
- A web page can be composed of several objects, which means many requests may be needed.
Message
- start line : the start line typically includes the HTTP method (e.g., GET, POST), the target URI (Uniform Resource Identifier), and the HTTP version being used.
- header : headers include Content-Type, Content-Length, User-Agent, and Host.
- body: In requests, the body often carries data submitted by the client, while in responses, it contains the requested information or data.
Tcp connection
- TCP is a lower-level concept in networking compared to HTTP.
- A TCP connection is established first, and then HTTP communication occurs.
- The following sequence is followed:
- The web browser extracts the host name from the URL and translates it into an IP address.
- The web browser finds the port number in the URL (if available).
- The web browser establishes a TCP connection with the web server.
- The web browser can communicate with the web server at the HTTP level.
This article is based on "http definitive guide".
'Backend > Network' 카테고리의 다른 글
[Network] Proxy (0) | 2024.02.05 |
---|