WEBVTT

00:00.170 --> 00:03.950
Hey, everyone, and welcome back to the Knowledge Portal Video series.

00:03.980 --> 00:09.560
Now, in the earlier lecture, we were discussing the basic about what protocols are all about.

00:09.590 --> 00:14.740
Now, continuing our journey today, we'll be discussing the basics of Http protocol.

00:14.750 --> 00:19.070
So let's go ahead and understand more about it with a simple use cases.

00:21.330 --> 00:23.850
So on the left hand side, you have a client.

00:23.850 --> 00:28.440
Let's assume this as a web browser, a Google Chrome or a Mozilla Firefox.

00:28.440 --> 00:31.230
And on the right hand side you have a web server.

00:31.470 --> 00:35.880
So this web server has certain files within it.

00:35.910 --> 00:38.460
Now, there are three files that you will see over here.

00:38.490 --> 00:45.120
One is movies dot HTML, second is documentary dot mp4, and third is my song dot mp3.

00:45.450 --> 00:52.310
Now this client wants to play documentary dot mp4, which is there within the web server.

00:52.320 --> 01:00.840
So in a very simple terms, how this would really work is the client or a web browser will send a request

01:00.840 --> 01:05.910
to the server asking that I want to watch documentary dot mp4.

01:06.330 --> 01:13.380
Now, depending upon the settings configured in the web server, the web server will reply back saying

01:13.380 --> 01:21.340
that here you go and it will send the documentary dot mp4 file back to the client's web browser.

01:21.640 --> 01:28.870
Now, depending on what kind of player like VLC or HTML5 player, what kind of player a browser has,

01:28.870 --> 01:35.440
it will go ahead and play this documentary MP4, which the server has sent back.

01:35.800 --> 01:41.620
So this is a very simple way of communication between a client and a server.

01:41.850 --> 01:44.530
Http protocol is very similar.

01:44.530 --> 01:47.890
So let's take an example of Http protocol now.

01:48.190 --> 01:55.450
So a web browser will send a request to the web server this time instead of the plain English language

01:55.450 --> 01:56.770
which we had used.

01:56.830 --> 02:00.010
They will be using the Http language.

02:00.310 --> 02:02.700
So what web browser will do?

02:02.710 --> 02:09.700
Web browser will send a request which would be get followed by the name of the file, which is get documentary

02:09.730 --> 02:10.870
dot mp4.

02:10.900 --> 02:15.730
Get basically means that I want to fetch this specific file.

02:16.210 --> 02:25.030
So web server will understand that the client wants to fetch the documentary dot mp4 so the web server

02:25.030 --> 02:32.830
will fetch the documentary MP4 and it will send it back to the client.

02:33.370 --> 02:37.000
Now in the response you see, you have 200.

02:37.000 --> 02:37.510
Okay.

02:37.540 --> 02:38.440
200.

02:38.440 --> 02:38.770
Okay.

02:38.770 --> 02:42.520
Means your request has been successfully processed.

02:42.520 --> 02:46.480
And this is the documentary dot mp4.

02:46.630 --> 02:53.260
Along with that, the web server will also have a header called as content type, which basically tells

02:53.260 --> 03:01.540
what type of content it is, which basically signifies that this specific file is a type video and sub

03:01.540 --> 03:02.680
type is mp4.

03:02.710 --> 03:10.270
So now the web browser will understand that the file which the web server has sent it is of type video

03:10.270 --> 03:16.990
and MP4, and then it will play this specific file according to the player that it has.

03:17.140 --> 03:25.600
So very simple way of communication between a web server and a client.

03:25.600 --> 03:27.040
So let's do one thing.

03:27.040 --> 03:32.230
Let's fire up our Wireshark so this things become much more clear to us.

03:33.760 --> 03:36.010
So let's do one thing.

03:36.010 --> 03:39.880
I have my wireshark up and running, so there are three interfaces over here.

03:39.880 --> 03:43.600
I'm using Wi-Fi, so I'll be selecting the Wi-Fi interface.

03:44.020 --> 03:47.020
So I'll start the capture.

03:47.020 --> 03:52.660
And now let me go ahead and type Dexter Labs dot in.

03:54.490 --> 04:03.700
So this is a very simple page where you have a text information call as let's say, Http and you have

04:03.700 --> 04:06.730
a simple labs dot logo which are designed.

04:07.900 --> 04:12.790
So when you go to the Wireshark now I'll stop the packet capture.

04:17.790 --> 04:20.010
Let's go down.

04:22.340 --> 04:25.640
And this is the get request that was sent.

04:26.120 --> 04:27.670
Let's do one thing.

04:27.680 --> 04:33.530
I'll right click here and I'll select follow the TCP stream.

04:33.920 --> 04:35.240
So.

04:38.340 --> 04:40.050
Let's find it out.

04:40.050 --> 04:41.220
Follow TCP stream.

04:42.030 --> 04:42.970
Perfect.

04:42.990 --> 04:47.580
So now what has happened is this is all internal happenings.

04:47.580 --> 04:50.030
You will not see this in the browser.

04:50.040 --> 04:59.430
So what happened was browser sent this request when we typed Dexter Labs in browser, sent a get request

04:59.430 --> 05:01.830
on the host Dexter Labs.

05:04.580 --> 05:11.180
Now the Web server which is running here, which is running on Dexter's labs and receive the request

05:11.180 --> 05:14.480
and it responded back with 200.

05:14.480 --> 05:14.900
Okay.

05:15.080 --> 05:16.010
200.

05:16.010 --> 05:16.370
Okay.

05:16.370 --> 05:21.830
Basically means the request that my browser made is successfully processed.

05:22.040 --> 05:29.060
And along with that it sent HTML contents back, which you will see you have.

05:29.060 --> 05:34.430
Let's Http and you also have the labs hyphen logo dot PNG.

05:35.180 --> 05:38.370
So this is what actually happened behind the scenes.

05:38.390 --> 05:44.330
Now if you'll see over here, along with the get request, there are a lot of other Http headers which

05:44.330 --> 05:47.310
the browser has sent to the web server.

05:47.330 --> 05:54.110
Now all of these are very important for communication and depending upon the headers which the browser

05:54.110 --> 06:00.950
or a client sends to the web server, the web server will respond according to that.

06:01.640 --> 06:07.680
So this is a very simple way of communication.

06:07.680 --> 06:12.900
So this response that you see over here, you can actually see in the web browser.

06:12.900 --> 06:20.340
So if you right click over here and do a view page source, this is the exact contents that you will

06:20.340 --> 06:21.040
see over here.

06:21.060 --> 06:26.630
So this is the high level overview about the Http protocol.

06:26.640 --> 06:35.010
In the subsequent lectures we will be discussing about each and every headers, which are part of a

06:35.010 --> 06:42.600
routine Http communication so that it will give us a very solid foundation in the Http protocol.

06:43.170 --> 06:51.570
So if you might be wondering how these things are decided and the answer to this is the RFC of Http

06:51.570 --> 06:52.050
protocol.

06:52.050 --> 07:01.380
So RFC basically contains the rules of a Http protocol, and these rules are being followed both by

07:01.380 --> 07:03.780
the client as well as the web server.

07:03.780 --> 07:09.100
And since the rules are followed on both the ends, the communication can proceed.

07:09.120 --> 07:13.810
So we'll be discussing more about all of these in the subsequent lectures.

07:13.830 --> 07:20.790
I hope you understood the basic about the Http protocol in a high level overview and if you have any

07:20.790 --> 07:26.940
doubts, suggestions, questions, feel free to connect us at Twitter, Facebook or LinkedIn or mail

07:26.940 --> 07:29.370
us at instructors at the Rate Labs dot in.

07:29.460 --> 07:30.660
Thanks for watching.
