req.is()
如果此請求宣告的 "Content-Type" 符合指定的媒體/MIME type
,則返回 true。
具體來說,此方法將給定的 type
與此請求的 "Content-Type" 標頭進行比對。
req.is(type);
假設請求包含 "Content-Type" 標頭,"text/html; charset=utf-8"
req.is('html');
// -> true
req.is('text/html');
// -> true
req.is('text/*');
// -> true