req.accepts()
Checks whether this request’s stated list of “accepted” media types includes the specified type. Returns true or false.
Usage
req.accepts(type);
Example
req.accepts('application/json');// -> truereq.accepts('json');// -> true
Notes
- See the
acceptsmodule for the finer details of the header parsing algorithm used in Sails/Express/Koa/Connect.
