HTP Heathers, hello, everyone.
Welcome back to the course.
Today, we're going to talk about HTP Kidder's and what HTP killers, if you remember, who actually
did some calling regarding them.
HTP killers are basically the information that HTP file contains, which is located on the top of the
HTP message.
In the for example, you can see in front of you how actually the HTP killer looks like.
So you have hear what is being accepted, what is the sentence coding.
What is the sentence language.
What is the connection.
What is the cost and also the browser that we enter from quite simple.
So usually the HTP request contains two main parts disserve the header in the body.
So usually in the header you can see information about the specific data that is inside the HTP protocol,
and it will basically do how you can interpret the data.
For example, here, if you have the asset language to us English, we know that the rest of the code,
it's probably going to be in the US English or the whole website actually.
For example, quite important part of the header is the host header because many of the websites out
there or the Web server section out there allows you to host more than one website at the same time
using the same IP address.
So, for example, if we're using the DNS protocol, you can have various to website domains, but of
course it from the same IP address.
So let's write one code that is actually going to show this.
So let's write the script that will actually obtain a header over a website using the response object
in response to libraries that we already know.
So here in this project that you already created here by opening the exceptional UI.
So here, if a person you file and I select Python file, let's name it here, there's.
Kidders, OK, so now we're taking the kids file and this file, as you can see.
Once we created it, it is automatically created inside our resource folder.
So now we have here the heroes will be white and we can actually write code inside it.
So let's write let's write the hashtag and then the user slash bin slash E and the V.
Python three.
OK, so this is the environmental files and then this right import, you are L Library DOT request.
And then and that's right, Eurail is going to be the name of what we're creating input's.
And then in third.
D you rl same column, and here we're going to ask the user to actually enter the euro now.
That's right, HTP.
Response, you quote to Eurorail library dot request dot Eurail.
Open ended right here, your you are out.
OK, so we will take the euro that the user has imported with the input command and then we're going
to do an open of this IP address or this.
You are actually so let's write them HTP, actually, all right, if HTP.
Underscore.
Response.
Actually misspelled this, OK, stupidness corresponds to the DOT code is equal to 200, so this means
that our request has been accepted and then we would like to print HTP response DOT.
Cather's.
OK, and then for.
Key Coahoma value in HTP response.
Don't get Kidder's.
OK, here I misspelled for.
Let's see, OK, this is from Wolf now, so for Keun value in getthere, there's old age to tip your
response, let's print key and vital.
OK, so we're going to print both of those elements inside our get headers.
So let's actually save that.
And they say that and let's go to our terminal.
I hope you understand what's happening here.
We're simply going to output the header and print some additional information about it.
But let's from the code and see what happens.
So if it was here, you can see that now we have two files and I will do Python exceptional.
Not quite.
Let's run the code.
Oops, sorry.
We had to run actually the headers.
So let's from here there will be way and it asks you to write your so I write htp YouTube dot com.
And let's see what happens here.
So as you can see, guys, the call to went through YouTube dot com, where did I write it here?
And then we started getting all the content of the YouTube dot com so we can see the date.
We can see some security guidelines.
You can see the server name itself.
This is also the server of YouTube.
We can see the set cookies mechanism and so on.
You we will get information for the search for multiple servers.
So this is how basically the header looks like and this is how you are basically getting the header,
the key and the value of the header as well.
So that's it.
Guys, thanks very much for watching.
I hope the HTP shares are careful now and how we can basically extract this information from Internet.
Please bear with me in the next video where we're going to cover the other agents.
Thanks for watching.