O'Reilly logo

Node Web Development by David Herron

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

MIME types and the MIME npm package

There are many details to get right in the HTTP protocol to implement a successful and correct web server. One of the details is the Content-Type header borrowed from the MIME protocol.

The MIME protocol was originally developed in the early 90s for improving e-mail capabilities; the HTTP protocol was developed in the same time frame, and both had the same core challenge. Namely, to identify the data format of the attachments to e-mail messages or HTTP requests. File extensions are insufficient to properly identify the file type because three characters (or so) are much too short to be a useful identifier, and there is no standard for file name extensions. Instead, we designed the Content-Type header and the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required