The Hard Parts of Servers & Node.js Response Headers
Transcript from the "Response Headers" Lesson
>> Will Sentance: Two quick things before that, actually, sorry, two brief things before that. One, the return back message [SOUND] is also in HTTP format. We use the body bit of it to send any data, like hello, in the headers of the return back message. It's the same format, get request line with the headlines.
[00:00:18] This is the headline bit, what you absolutely, the headline, the request headers and the body. The headers bit on the message you send back can also include things like content type. Like, hey, what we're sending back to Michael's Mac is HTML. Hey, web browser Chrome, Safari on Firefox on Michael's Mac, you're receiving here, not plain text, don't try and load it as text, interpret as HTML.
[00:00:43] And so we can actually add to this message headers and these metadata about the data we're sending back. Say, hey, this is HTML, please interpret it as such, using properties like content type. You're gonna see this in the pair programming. But you've just gotta make sure this message has all the information the browser needs to be able to load up the data in the right way.