Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Build a Simple Dynamic Site with Node.js!
You have completed Build a Simple Dynamic Site with Node.js!
Preview
You can specify what type of content you serve by modifying a header called Content-Type.
Further Reading
- Internet Media Types Wikipedia Article
- The list of Media Types are no longer on Wikipedia, but can be found on IANA's website. IANA is a standards body that issues media types.
Node.js APIs Used
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
As part of the HTTP specification, or how
servers and browsers agree to talk to each
0:00
other, there are values that are hidden
from the user called Headers.
0:00
These headers can be programmatically
created by the clients and the server.
0:05
Once each headed that the service ends,
it's called Content Type.
0:10
The instructs the browser how to handle
the string of information in the response.
0:15
The browser would have no other way of
knowing what to do with it.
0:20
The data in the response looks the same to
the browser, just a string of data.
0:23
Let's take a look at our code right now,
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up