How HTTP works
Hypertext Transfer Protocol (HTTP) provides a network protocol standard that web browsers and servers use to communicate. You see HTTP every day because when you visit a website, the protocol is written right in the URL.
This protocol is similar to the file transfer protocol in that it is used by the client program to request files from the remote server. In the case of HTTP, usually a web browser requests HTML files from the web server, then displays in the browser with text, images, hyperlinks and related assets.
Because browsers by default communicate using HTTP, you can usually remove the protocol from the URL when typing in the browser's address bar.
To learn more, please refer to the article: What is HTTP?
How HTTP works
HTTP is an application layer protocol built on TCP, using a communication model between the client and the server. Client and HTTP server communicate via request and response messages. The three main types of HTTP notifications are GET, POST and HEAD.
- HTTP GET - The message sent to the server contains only one URL. No or more optional data parameters can be appended to the end of the URL. The server processes the optional data portion of the URL, if any, and returns the result (a web page or web page element) to the browser.
- HTTP POST - The message places any optional data parameters in the body of the request message, instead of appending them to the end of the URL.
- HTTP HEAD - Requests act the same as GET. Instead of replying with the full text of the URL, the server only sends header information (included in the HTML section).
The browser starts communicating with the HTTP server by starting a TCP connection to the server. Web browsing sessions use server port 80 by default, although other ports such as 8080 are sometimes used instead.
After the session is established, you enable sending and receiving HTTP messages by visiting the website.
HTTP is a stateless system. This means that unlike other file transfer protocols such as FTP, the HTTP connection is canceled after the request is completed. Therefore, after the web browser sends the request and the server responds to the page, the connection will be closed.
Troubleshooting HTTP
Messages transmitted over HTTP failed for a number of reasons:
- User error
- Malfunction of web browser or web server
- Error creating site
- Temporary network problem
When these errors occur, the protocol that captures the cause of the error and reports the error code back to the browser is called the HTTP status line / code. The error begins with a certain number to indicate what kind of error it is.
For example, errors with error codes starting with 4 indicate that the request for the page could not be completed properly or the request contained incorrect syntax. For example, a 404 error means that the page cannot be found. Some sites even offer interesting custom 404 error pages.
You should read it
- 5 ways to improve website speed with HTTP / 2
- MQTT and HTTP: Which protocol is better in the IoT era?
- What is HTTP
- Caching in HTTP
- Things you should know about HTTP / 2 protocol
- Parameters in HTTP
- Security in HTTP
- Message in HTTP
- Request (HTTP) in HTTP
- What is HTTP Flood?
- Warning: Vulnerability in Windows' HTTP Protocol Stack attacks remote code execution, no authentication required
- Web14: Security issues in the HTTP protocol
Maybe you are interested
How to enable automatic HTTPS on Edge
How to fix Analytics Http failure response for 499 OK realtime
Find out what is HTTPS? Why should you use HTTPS instead of HTTP?
What is HTTPS? Why is it needed for your website?
Web10: Some forms of fake http headers
What is HTTP Security Header? How to use HTTP Security Header