This course has been updated! We now recommend you take the Complete Intro to Web Development, v2 course.
Transcript from the "Client & Server" Lesson
>> Nina Zakharenko: Let's talk a little bit about the client and server and what happens when you're on a web page. So you're on the web page and you click a link. What happens behind the scenes is the client is creating an http request and it's sending it over to the server, so it's like knock, knock, server, I want this.
[00:00:25] And the server is gonna come back and say I have it or I don't. So the server finds the thing that you asked for, bundles it up, and sends it back to the client. After this, the client decides what it's going to do with it. If it's an image or an HTML page it's going to go ahead and display it.
>> Nina Zakharenko: So this is a really brief example of an HTTP request. So GET is an HTTP verb, so you're sending this instruction to the server, you're saying get me this link.
[00:01:16] The version of HTTP I'm using is 1.1, which is not important, the host is which server these resources will live on, and the accept is what the client is expecting to get back. So the server will handle the request and it's going to send back something like this to the client.
[00:01:41] The number 200 and OK is important, 200 is an HTTP status code. So the client end server don't need to know, they don't need that okay message, they know purely by that number that everything went exactly as planned. And so you'll get back in this example some html, and then your client, your browser knows how to translate that into what we see.
[00:02:10] So colors, images, different font sizes.
>> Nina Zakharenko: Now here's a page that we've all seen a lot, and why does this happen? It means that the web server couldn't find the file that you asked for. So you asked for a file that doesn't exist. So some really common HTTP Status Codes, ones we probably see almost everyday, 200 means okay, 404 means that that file wasn't found, and 500 is a server error.
>> Nina Zakharenko: So a good way of figuring out what your status code means, if you see it, ones in the hundreds are purely informational. Ones in the two hundreds indicate success of some sort. Three hundreds are redirection, so that means something has moved. Four hundreds are client errors, and five hundreds are server errors.