HTTP in Detail
Requests and Responses
When we access a website, your browser will need to make requests to a web server for assets such as HTML, Images, and download the responses. Before that, you need to tell the browser specifically how and where to access these resources, this is where URLs will help.
Scheme: This instructs on what protocol to use for accessing the resource such as HTTP, HTTPS, FTP.
User: Some services require authentication to login.
Host: The domain name or IP address of the server you wish to access
Port: The Port that you are going to connect to.
Path: The file name or location of the resource you are trying to access
Query String: Extra bits of information that can be sent to the requested path. For example, /blog?id=1 would tell the blog path that you wish to receive the blog article with the id of 1.
Fragment: This is a reference to a location on the actual page requested. This is commonly used for pages with long content and can have a certain part of the page directly linked to it, so it is viewable to the user as soon as they access the page.
HTTP Methods
HTTP Status Codes
Headers
Headers are additional bits of data you can send to the web server when making requests
Cookies
Cookies are small pieces of data that are stored on your computer. Cookies are saved when you receive a "Set-Cookie" header from a web server. Then every further request you make, you'll send the cookie data back to the server. Because HTTP is stateless (doesn't keep track of your previous requests), cookies can be used to remind the web server who you are.
The cookie value won't usually be a clear-text string where you can see the password, but a token (unique secret code that isn't easily humanly guessable).
Last updated