Lesson 9.4
Finishing res.send
res.send infers a content-type from its argument, the charset that prevents mojibake, the chapter's bodyless-response policy, and the MIME table behind res.type.
What you will build
- Infer text/html, application/json, or application/octet-stream from res.send's argument, in the correct type-check order.
- Suppress content for 204/205/304 while giving each status valid HTTP/1.1 length framing.
- Map an extension or shorthand to a MIME type, appending charset to text types only.