response.hasHeader(name)


如果响应头有设置 name 响应头,则返回 true。 响应头名称匹配不区分大小写。

例子:

const hasContentType = response.hasHeader('content-type');

Returns true if the header identified by name is currently set in the outgoing headers. Note that the header name matching is case-insensitive.

const hasContentType = response.hasHeader('content-type');