Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

NodeJS Content-Type

res.type('.html')            // => 'text/html'
res.type('html')             // => 'text/html'
res.type('json')             // => 'application/json'
res.type('application/json') // => 'application/json'
res.type('png')              // => 'image/png'
res.type('mp3')              // => 'audio/mp3'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #NodeJS
ADD COMMENT
Topic
Name
3+8 =