In this video.
What we are going to do is we want to know more about the request and then the response in case something
goes wrong.
How can we rectify?
Or if everything was okay, how can we have the visualization of the actual response?
Well, we can still use the terminal to have a peek into the response.
For example, if something goes wrong, then will we be able to see inside the terminal?
But we also have the browser where we can also have a peek into the request and then response.
In that way it will help us to debug an error in case there is one.
So first step is let's run the server that is node server and you can see that the server is up and
running.
The next step is let's enter.
You are into the browser that is local host colon 9000.
When I hit Enter now we get back our response.
So to know more about the response, we are going to use the console.
So open the console.
Next step is you can see we have couple of taps here, but the one that we care most is called the network.
And under our network it can see we have couple of tabs here.
So this tab tells you more details about their requests and their response.
So we are going to use few of them, for example, the O and then fetch a child JavaScript and CSS.
So let's click on all meaning.
You want to have everything about the response concerning the request, the loading of JavaScript in
any asset.
So click on all and now let's click on or refresh the URL or the page.
So as soon as I refresh it, you can see that we have additional tabs here, which gives details about
the request and then response.
You can see we have name that specify the URL of which we entered that is a lookout host and we have
the status code telling us that is 200, which simply means the request or the response was successful.
And we also have size which tells us the size of our file and at time represents the time the content
got loaded.
It took 3 seconds to be able to display this HTML template.
Now let's click on Look our host and you can see that we have couple of tabs here, headers, preview,
response, initiator and timing.
So what we care most is these three headers preview and response if you click on headers.
You could see that you also have additional taps here and we have what is called requested u r l this
is a u r of the user requested.
That is a home page as that.
And then we have what is called referrer policy.
Don't worry about this.
If you get back to experts, you know more about cross origin and and our request header is we have
accept meaning the kind of file this server can accept and we have accept encoding as that.
And the language of the server by default is English.
And the host here as we spoke about, represent what is called the lookup host.
That is the current connection device.
So these are a few properties about the headers.
Well, the header changes depending on the HTTP method.
If you use post, if we see that you want to see the payload or the actual content inside the header
as we move on, we'll be coming here to explore more and in the preview when I refresh it and let's
click on that and preview it, we see that this is what came back after the request and then response
is what kind of data that got back.
And definitely it's an HTML because is a HTML that got into the browser and the browser gives us what
we have here.
So as we move on, we be coming back here to revisit this page.
Let's try to shut down a server like that and now let's refresh it and have a look.
And we see that something has happened, meaning status, which means failure, meaning that the connection
was not successful.
And if you click on that and click on headers, you see more about the information we see fail to load.
So we can use this tool to have a peek into our response and request the next video.
We are going to start our first coding challenge.
So let's get rocking then this video.