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