HTTP Proctol - what is it?

Search for a command to run...

No comments yet. Be the first to comment.
Are you listing your apartment for sale? Great! A shiny new listing online, beautiful photos, a detailed description... But you know what? For a buyer, it's just information. For a thief, it's a ready-made plan of attack. It may sound like a scene fr...
How can you satisfy your curiosity in your free time? How can you combine your free time with learning and deepening your technical knowledge? How do you feed that curiosity that keeps growing as you dive deeper into the unknown? There are certainly ...

In the era of the Internet, especially today, when even companies specializing in cybersecurity fall victim to hacker attacks, the question arises: is it possible to win a fight that seems lost from the start? If companies that have been developing s...

In today's world, cyber-attacks are becoming increasingly sophisticated, posing significant challenges in combating cybercriminals. Virtually every imaginable device is interconnected via the Internet, enveloping us in the cyber realm. Cybercriminals...

A fiber optic cable LC type is visible above.

HTTP (Hypertext Transfer Protocol) is the rules of information exchange and program cooperation. Servers and clients communicate. The client sends requests and the server responds. An example of an HTTP client is a web browser. Clients may interpret the obtained responses differently. For example, a web browser can display a website that has been sent by the server.
The browser does quite a few things in the background ... Did you know that the browser makes over 300 HTTP requests to display amazon.com?
Communication between the server and client is based on many other protocols. This set of protocols is called the ISO / OSI model. This model contains layers. Each layer, based on the previous ones, provides additional functionalities. HTTP is at the top layer of the model, the application layer.
We know that the customer is sending requests. Each request is associated with a resource. The resource can be an image, HTML page, text file, video file, gif. The HTTP protocol itself does not define what exactly a resource is. It only defines the way in which the resource can be accessed. Each resource has its own unique identifier. This identifier is the URI (Uniform Resource Identifier).
The HTTP protocol precisely defines the communication format between clients and servers. This communication is based on the requests and responses already mentioned. HTTP defines the format of these messages.
HTTP is a stateless protocol. This means that each query can be interpreted in isolation from the others.
The URL looks like this:
scheme: [// [user [: password] @] host [: port]] [/ path] [? query] [# fragment]
**scheme:**
In practice, this part of the address is used to specify the protocol, most often you will see http or https.
**user: password**
user: password are used for authentication.
**host**
In the case of HTTP, it comes down to the Internet domain name or IP address.
**port**
The port is the number. This number is used by the server. The server is listening for traffic on a given port.
**path**
This part of the URL is the path that specifies the resource.
**query**
Contains additional data identifying a given resource. This part is separated from the path by the '?' sign (question mark).
**fragment**
The last part of the url. In practice, it is used to define the fragment of an HTML page that should be shown to the user.
According to the HTTP specification, the letters are case insensitive in the scheme and host parts. The rest of the elements are case sensitive
Headers are attached by clients to outgoing queries and by servers to outgoing responses. They are in the form header-name: header-value. According to the specification, the capitals are not case sensitive.
You already know that HTTP is stateless. The HTTP server cannot combine queries from the same client into one package. Cookies come to the rescue. Cookies are specific headers that are handled by clients.
In response, the server may send a header that will create a cookie. This cookie is bound to a domain (the host and path part of the URL). An exemplary header for setting a cookie may look like this:
As MDN says HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
Informational responses (100–199)
This group of statuses are informational statuses. Inform clients that a request has been received and is being processed.
Successful responses (200–299)
Statuses in this group inform that the query has been correctly processed.
Redirection messages (300–399)
Statuses starting with 3 inform clients that additional action must be taken to complete query processing.
Client error responses (400–499)
Server error responses (500–599)
The server informs clients of a server-side error that prevents the query from being processed.
Now you know what the HTTP protocol is for and how it is built. I hope you learned something from my today's post, if so, let me know! It will be nice if you write what you think about my thoughts and the way of writing. To the next!