WEBVTT

00:00.450 --> 00:03.030
Welcome back to the Knowledge Portal Video series.

00:03.360 --> 00:09.390
Today we are going to talk about one more Http method called as Post.

00:10.470 --> 00:15.540
In order to understand post, let's take a simple example of a login form.

00:20.290 --> 00:22.150
So this is a simple login form.

00:22.150 --> 00:29.440
We all have gone across a login form when we used to enter a username and password and it can either

00:29.440 --> 00:32.620
allow us to login or it will say incorrect password.

00:33.930 --> 00:36.420
Now during these cases.

00:37.390 --> 00:42.500
So during let's say you open gmail.com and it asks you for a username and password.

00:42.520 --> 00:49.240
So essentially here you have to post some data to the application and click on sign in.

00:49.510 --> 00:55.870
Application will verify whether the username and password that you have entered are correct or not and

00:55.870 --> 01:01.090
depending upon that it will either give you access or it will not give you access.

01:03.760 --> 01:10.960
So in this time, what essentially you are doing is you are posting some data to the application that

01:10.960 --> 01:12.490
is running on the web server.

01:13.120 --> 01:20.830
And during this time is when you use the Http post method because get won't work here.

01:22.930 --> 01:30.580
In a nutshell, a Http post is used to send some data to the server to be processed in some way.

01:31.420 --> 01:39.160
In this example we are posting or we are sending username and password to the application so that the

01:39.160 --> 01:41.410
application can process it.

01:41.410 --> 01:46.240
By process I mean validate whether a username and password are correct.

01:48.580 --> 01:57.280
If we take a look at the example of a login form here instead of get we have post method on login dot

01:57.580 --> 02:05.860
PHP and in the body section we have user is equal to admin and password is equal to test one two, three.

02:06.580 --> 02:11.530
And this is one of the reasons why the http post method is used.

02:12.500 --> 02:18.740
Now let's go to our lab section and see on how post is generally used.

02:20.670 --> 02:21.900
What I'll do is.

02:23.510 --> 02:27.230
Let's open Wireshark and start our packet capture.

02:28.620 --> 02:34.730
I click on Start and go to Mozilla and let's open a simple login form.

02:35.190 --> 02:36.420
Login.html.

02:38.360 --> 02:41.330
And here it is asking for a username and password.

02:41.540 --> 02:44.620
So username and password.

02:44.630 --> 02:50.040
I'll put my password and when I click on login over here it will log me in.

02:50.060 --> 02:55.100
So what essentially we are doing is we are posting our username and password to this particular web

02:55.100 --> 02:58.100
application which will validate it and.

02:59.290 --> 03:01.630
It will either allow us or it will not allow us.

03:01.630 --> 03:03.400
So I'll click on login over here.

03:03.490 --> 03:06.970
And here you see it has allowed us inside.

03:07.480 --> 03:13.810
Now let's look at the Wireshark packet capture and see what has happened behind the scenes.

03:14.800 --> 03:16.420
I'll filter based on Http.

03:18.000 --> 03:20.070
It will be much more simpler.

03:21.310 --> 03:22.240
Initially.

03:22.240 --> 03:28.780
What has happened is our browser has sent a get request to the login.html.

03:29.950 --> 03:34.890
On the web server and the server responded back with the login form.

03:34.900 --> 03:37.180
So this essentially is the login form.

03:37.390 --> 03:38.590
I'll close this.

03:39.190 --> 03:43.540
And now after we have entered the username and password.

03:44.480 --> 03:47.030
The request became post.

03:48.810 --> 03:53.160
So let me filter back to Http.

03:53.190 --> 03:56.760
And if we see over here, there is a post request.

03:56.760 --> 04:03.840
So if I follow the TCP stream now after we enter the username and password, the request essentially

04:03.840 --> 04:04.830
became a post.

04:06.690 --> 04:12.390
And also here you see login is equal to zero and password is equal to password.

04:12.390 --> 04:18.630
So my password was password in plain text and this is the login button.

04:19.140 --> 04:24.120
The server will validate it and it will either allow us or either it will not allow us.

04:24.240 --> 04:30.090
Now this essentially becomes a post request because in the body itself we are giving the username and

04:30.090 --> 04:32.790
password and sending it back to the server.

04:33.780 --> 04:39.000
And this is one of the reasons why the Http post method is used.

04:39.420 --> 04:41.070
So essentially if you see.

04:42.160 --> 04:49.000
Or if you think on where post can be used, then there are endless number of possibilities where http

04:49.000 --> 04:49.870
post is used.

04:50.170 --> 04:56.830
Take for example google.com where you have a search bar and where you enter whatever you want to search

04:56.830 --> 05:01.010
and you click on Google Search and Google will present with you all the results.

05:01.030 --> 05:07.420
So during that time, also essentially the Http post is used because you are posting some data to the

05:07.450 --> 05:08.920
Google application.

05:09.880 --> 05:12.700
This is it about the simple http post.

05:13.710 --> 05:14.420
Request.

05:15.010 --> 05:17.370
I'll suggest you to try this practical.

05:17.370 --> 05:24.150
Also follow the labs that I have given and try to do a wireshark packet capture also.

05:24.720 --> 05:25.650
This is it.

05:25.650 --> 05:26.730
About this lecture.

05:26.730 --> 05:31.200
I hope this has been informative for you and I'd like to thank you for viewing.
