[0:00]Now you know that if two devices need to talk to each other on the internet, they need to establish a connection. And we learned about one such protocol that helps us to do that, which is the TCP protocol, Transmission Control Protocol, right?
[0:13]It helps us create a connection between two devices over the internet with the help of something called as a three-way handshake, which was uh Sin Sinac Act. And once this connection is established, they need to now start transferring information between each other.
[0:28]And how do you do that? So how do you once after the connection is established, how do you actually start sending information between the devices? Now, that's something that can be done with uh a protocol that builds up on the TCP protocol, and this protocol is called HTTP or the Hypertext Transfer Protocol.
[0:45]Now, the way the HTTP protocol works is that you send or the device, right? The receiver sends a request to the server, the server sends back some information as response.
[0:56]So, the two important things, the request that the receiver makes, receiver of the information, and the server or the sender of the information sends back a response to the receiver. All right, so whenever you go to any website, you just type HTTP,
[1:13]and then www.google.com. That's how you visit websites where you enter this in your browser, right? And that basically means that HTTP is a very fundamental protocol for how we experience the internet, right?
[1:26]And so, anyone who's wanting to visit a website is going to make a request to a server from their mobile device. And the server is basically sending back an HTML page that can be rendered on the device.
[1:38]Now, this HTML page is actually coming back as an HTTP response that we discussed.
[1:42]Just want to take a quick break to tell you something important. If you have some years of experience in the industry, you know that just knowing system design concepts is not enough. You need to know how to break down complex problems and apply all of the concepts that you know.
[1:55]Now, there are many system design courses on the internet, but they break down simple problems like e-commerce platforms, social media platforms.
[2:01]But what about someone breaking down Open AI, or Hacking Face, or Cursor, the kind of platforms that will be built in 2025 and beyond.
[2:10]And this is why I've built the perfect three-month advanced system design boot camp, where you break down distributed systems problems, decentralized platforms problems, and AI infrastructure problems.
[2:20]This cohort is for more advanced people who have a few years in the industry, they know quite a lot of system design, and are now looking to upskill.
[2:27]If you think you're a good fit, there's a form in the comments and in the description of this video, fill it up. We'll check if you're a good fit, and we'll set up some time with you. Now, let's get back to the video.
[2:36]Now, request and response actually, they contain a few things. So a request has something called as a request header. This is what it looks like. This is the header.
[2:45]So you'll see something called as Get here. Now Get is a HTTP method. And we have many more HTTP methods. One of them is called Post.
[2:56]Now, get and post are the two most common ones, and we look at what they exactly do and more such HTTP methods in a future video.
[3:03]So we're making a get request using HTTP 1.1. Now, HTTP has multiple versions. There's HTTP 2, there's HTTP 3, right? In this case, we're using 1.1. We'll learn about these two also in the future videos.
[3:13]We we have a user agent, which is basically the browser that's making the request, the Firefox browser using the Macintosh OS, uh Macintosh machine, and the Intel Mac OSX 10.9 as the OS.
[3:24]And the language that we want is US, right? The accepted encoding method could be Gzip, deflate, or BR, and who's the referrer? This is the referrer. We want to keep alive the connection and there's more information.
[3:38]So you're seeing that the HTTP header, it's called the HTTP header, the request header more specifically. This is a very rich object of information. There's a lot of information that's going on out here.
[3:49]And here you can also see what kind of information you want back from the server. You want text or HTML information. Now, this is a request body, right?
[3:59]So we're still talking about request, we looked at the request header. Now we're looking at the request body. In many cases, when you use the post method, you are trying to create something on the server. You're not just asking for information back, but you're trying to create something on the server.
[4:08]The server is actually connected mostly to a database. And to be able to create something at the database, you need to send something from the device to the server using the post method.
[4:20]And when you do that, you actually have to send a request body, you'll have to send a body in the request. And the body will have information like this, you know, like, So let's say this is a new object, we're going to create in the database.
[4:31]And it's going to have this name, description, price, and tax, you can see it's a JSON. And when you send this, the server receives this, and the server is able to create that as a new entry in the database table.
[4:41]Now, whenever you send a request to a server, you get back a response, right? You know that. So, response has a header. This is the response header.
[4:49]And this is all the information that the response header would have. So you'll have 200 OK. Now, 200 is actually an HTTP status code.
[4:57]So there are multiple status code, and you've seen this a lot, right? You've seen 500, which is an internal server error. You've seen 401, you've seen 404 not found.
[5:08]And you've seen 200, which is okay, which means that the server is working fine, everything is all right. The request was perfect, right?
[5:16]And then you have the content type that's been sent in the response. So you'll have a response body, you'll send something in the response body, which in our case, it says it's going to be HTML.
[5:25]So what we're doing here is, we're not asking for any JSON information. We're asking the server to send back an HTML page back to us so that we can render that on the mobile device for the user to see.
[5:34]And that can easily be noticed in our response header. Now, you also have the date and time stamps. You have keep alive, connection keep alive, and when was this information last modified on the server?
[5:46]And you have some more information about the cookie and back-end server, cache information, frame information, and so on.
[5:52]Now, like I mentioned, there are more HTTP methods and there are more versions of HTTP, and there are some things that we do to keep HTTP secure, like something that you've seen, right? HTTPS. And these are all the different things that we'll be talking about in the upcoming videos.
[6:06]Thank you so much for watching, and I'll see you in the next one.



