Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 523 Bytes

File metadata and controls

27 lines (17 loc) · 523 Bytes

res.type()

Sets the "Content-Type" response header to the specified type.

This method is pretty forgiving (see examples below), but note that if type contains a "/", res.type() assumes it is a MIME type and interprets it literally.

Usage

res.type(type);

Example

res.type('.html');
res.type('html');
res.type('json');
res.type('application/json');
res.type('png');