WEBVTT

00:03.820 --> 00:05.380
Hey, did everyone share?

00:05.380 --> 00:09.940
And in this video, I'll talk a little bit on the headers and then I'll walk you through with the documentation

00:09.940 --> 00:13.510
and we'll leave you to explore a bit more on the documentation side.

00:13.720 --> 00:18.430
So so far our application is kind of almost ready and we are handling all of the images and everything

00:18.430 --> 00:19.300
pretty nicely.

00:19.450 --> 00:24.430
Now in addition, what I want to do, I won't be changing it too much, but I just want to have a console

00:24.430 --> 00:25.210
log here.

00:25.210 --> 00:28.360
So I'm going to go ahead and say, Hey, please give me a log here.

00:28.360 --> 00:32.980
And this log will say a request dot header so I can go ahead and see what's all coming in.

00:32.980 --> 00:38.170
Now this I will get all up here so that I can see what is all happening up here in this case.

00:38.500 --> 00:39.640
I'll come back here in a minute.

00:39.640 --> 00:44.260
First, let's go into the swagger and just we don't need to create an entirely separate path.

00:44.260 --> 00:47.800
We can just modify this course, upload a little bit so that we can have this.

00:47.800 --> 00:49.840
I told you, requested body or request.

00:49.840 --> 00:52.030
Body is not the only one you can alongside.

00:52.030 --> 00:53.260
Pass on the parameters.

00:53.260 --> 00:56.110
Let's go ahead and do that that I want to send you some parameters.

00:56.110 --> 01:01.360
Also, the most important part of the parameter is mentioning where the parameters are coming in.

01:01.360 --> 01:02.740
So that's what it takes.

01:02.740 --> 01:05.920
And you define and again, a quick caution, don't use this.

01:05.920 --> 01:09.220
This is not a correct syntax of the YAML, this is the correct syntax.

01:09.220 --> 01:12.760
So in instead of the URL or anything, we are going to say header.

01:12.760 --> 01:17.290
We don't call it URL anyways, but we are going to go and said in the header.

01:17.380 --> 01:20.920
Now further down the road you can go ahead and name this one as simply auth.

01:20.920 --> 01:26.230
Now what this is going to do rather me just saying it, let me just show you that I'm going to go ahead

01:26.230 --> 01:27.220
and hit a reload.

01:27.820 --> 01:32.740
And now notice here you are saying that this is the auth value that can come up into the header.

01:32.740 --> 01:34.300
Let's go ahead and try this one out.

01:34.300 --> 01:40.480
So we're going to say this is a test auth, so we're going to go ahead and send this one.

01:40.480 --> 01:42.250
I would still like to check that.

01:42.260 --> 01:43.540
Are we sending the images?

01:43.540 --> 01:46.390
So I'm going to go ahead and choose my same image.

01:46.390 --> 01:51.160
I'm going to go ahead and open this up and let's go ahead and try to execute this one.

01:51.160 --> 01:56.230
Now, as soon as I execute, this is all good, but I'm looking for is what's coming up into the header.

01:56.320 --> 02:02.020
So notice here this time we are saying the cookie because we have accepted the cookie based authentication

02:02.020 --> 02:02.830
in this.

02:02.830 --> 02:04.960
The value that's coming up is token equals.

02:04.960 --> 02:06.430
This is a secure token.

02:06.430 --> 02:11.500
Not only that, I'm also getting a whole lot of headers that has a lot of good information.

02:11.500 --> 02:17.140
For example, I'm getting this auth, which is purely this one, so you can just provide an authentication

02:17.140 --> 02:22.510
headers and you can just go ahead and accept that into your request, which is being governed by the

02:22.510 --> 02:23.290
Express.

02:23.500 --> 02:26.890
Now, you have a whole lot of information about where this request got origins.

02:26.890 --> 02:31.780
What are the cause, the user agent from where this is coming up, you can even grab IP and a whole

02:31.780 --> 02:32.230
lot of that.

02:32.230 --> 02:34.840
But this is all what we wanted to discuss in this case.

02:34.870 --> 02:40.060
Now, I want to bring your attention a bit on to the documentation, because obviously I can try my

02:40.060 --> 02:44.530
best, but at the end of the day, you will be learning through the documentation after this one.

02:44.530 --> 02:49.450
So look into the authentication and you can see that this is where they get a lot of attention up here.

02:49.960 --> 02:54.220
So they say that this is all the components you can mention in the security schema, whether you are

02:54.220 --> 02:57.850
supporting the beer or basic auth or maybe the cookie based auth.

02:57.850 --> 03:02.800
Now you have to apply the security and you can apply the security of this auth and all of that.

03:03.070 --> 03:07.780
This is how it's being done and this is what I have mentioned up here.

03:07.810 --> 03:12.700
Now, quick notice here, you can also mention that this particular route is governed by the security

03:12.700 --> 03:18.160
measure, which is OAuth or maybe an admin at different kind of a scope that you can pass on scopes.

03:18.160 --> 03:23.830
Definitely is a little bit of doubt because as much as I, I can give to the swagger, I can define

03:23.830 --> 03:27.730
or create an entirety of a course on just the swagger, which can be really big.

03:27.730 --> 03:32.950
But I think we are now at a position that you can come up here, write the basic documentation and learn

03:32.950 --> 03:35.890
on the go as your project gets into the more complex stuff.

03:35.890 --> 03:40.690
I think this is still way more than what you have ever learned in any of the course or tutorial.

03:40.690 --> 03:44.230
This is a more precise and a better guide of doing all the things.

03:44.380 --> 03:45.820
I hope you have enjoyed it.

03:45.820 --> 03:51.370
I hope now you are at a full position of writing a great documentation and make sure you also show me

03:51.370 --> 03:55.810
something that what more you have added in here or how you are actually documentation look like?

03:55.810 --> 04:00.880
By the way, there is also an option that you can add your custom CSS into the swagger and can change

04:00.880 --> 04:01.840
a whole lot of things.

04:01.840 --> 04:06.070
I've seen people doing a whole lot of crazy stuff and absolute amazing one in there.

04:06.070 --> 04:09.580
So this is all what we'll be doing, at least in the swagger section.

04:09.580 --> 04:11.650
Let's go ahead and catch up in the next video.
