Hypertext Transfer Protocol
Whenever you go to your browser, type a URL, and press Enter, it performs complex actions and returns a webpage consisting of text, images, videos, spreadsheets, and hypertext. It may seem like only the client and server are involved in sending data, but in this article, I am more interested in discussing the basic aspects involved in making an HTTP request successful.
What is HTTP?
HTTP (Hypertext Transfer Protocol) is the base protocol that consists of rules for data communication on the World Wide Web. It is designed to send and receive data from a backend database using a URL (Uniform Resource Locator). The HTTP protocol is designed to run on the application layer at the top of the protocol stack in the OSI Model. HTTP typically involves two entities: a client and a server. The client makes the request using a URL, and in return, the server sends a response to the client.
What is HTTP Request?
HTTP Request is a way over internet in which client (web browser or a website) asks for information required to load a webpage, video, image, videos etc.
Each HTTP Request made across the internet consist of series of encoded data that carries different type of information.
When a request is made it must contain these essential details like request method, request headers and request body than a response is generated from the backend server that must contain response headers and response body too.
Please look at the image attached for your reference that will give you more clarity on how a HTTP request looks like.
What is HTTP Response?
An HTTP Response is a way in which web browser and client that sent a request previously receives a request from the backend database/server in response to the request made. These HTTP response contains some valuable information that is based on the information asked in the HTTP request.
A typical HTTP response consist of following information
Now Let's talk about HTTP Request and HTTP response in detail which will help us to understand each and every aspect in detail
Please look at the image attached for your reference that will give you more clarity on how a HTTP response looks like.
Recommended by LinkedIn
What are HTTP Request Headers?
HTTP request headers are specialized way of client(web browser, website) to send information to backend server to make them understand what is the information that the client is asking for
These HTTP request headers consist of following information
What are HTTP Request Methods?
HTTP request methods are also called as HTTP verbs, that indicates what action should be taken by the backend server. HTTP request methods helps to identify what action server should perform. Some of the major actions are
What is HTTP Request body?
The HTTP Request body consists of information that is transmitted over the communication channel from client to the backend server, information that is being processed by the backend server and then the response will be returned based on the data provided.
What is HTTP status code?
HTTP status code are 3 digit codes that basically indicated what actually happened to the request sent to the backend server. Some of the common and well known status codes are
What is HTTP Response Headers?
Unlike Request headers, response headers comes with different type of headers that conveys very important information like server related information, security headers information which is directly associated with security of the application requested.
What is HTTP Response body?
HTTP response body consist of information that is sent back by the server. This information could be different based on the HTTP request method used to send the request. GET method can have very huge data in the response body, POST method can have token or an API key that would be further used by the application to fetch data from the server. Therefore response body can differ in size based on the method used to send the request.
So, this was all about the basics that is required to understand HTTP to build the foundation to understand HTTP protocol in more detail.
Kindly stay tuned for more articles with detailed information.
Great breakdown