HTTP

Photo by Caspar Camille Rubin on Unsplash

What is it?

HTTP (Hypertext Transfer Protocol) is a communication protocol for sending and receiving information. Since the Web uses the HTTP protocol as a method for exchanging data between the browser and the server, it is one of the essential knowledge for front-end developers.

Photo by Florian Krumm on Unsplash

HTTP Features

The HTTP protocol is a stateless protocol.

Stateless here means that each data request to send and receive data is managed independently of each other.

This means the server will never remember the last request, no matter what. Therefore, even if the browser asks about the last request, the server cannot give any answer.

Thanks to this feature, the server does not need to manage additional information such as sessions, and there is a performance advantage that can handle a large number of requests and reduce the load on the server.

How does it work?

In order to send and receive data through HTTP, you need to send a request and receive a response as shown in the figure below. (Req and Res are often used when writing code.)

HTTP Protocol

URL

To understand how HTTP works, you must first know about URLs. URL (Uniform Resource Locators) is an English address entered to send a request to the server.

Photo by Remotar Jobs on Unsplash

Request

You can request data from the server by using the URL shown above. If you want to perform a specific action on the requested data here, you can use the HTTP Request Methods.

In general, HTTP request methods are also called HTTP verbs and have main methods as follows.

  1. GET: request data
  2. POST: Generate data
  3. PUT: data change
  4. DELETE: delete data
Photo by Kostiantyn Li on Unsplash

HTTP Status code

  • Response information set by the server
  • It provides detailed information about various statuses, such as whether the request succeeded or failed, what was the cause of the failure, and so on.

Click here to see all HTTP status codes

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store