hasContentType function

Matcher hasContentType(
  1. String type
)

Matches a response with Content-Type containing the given type.

Example:

expect(res, hasContentType('application/json'));
expect(res, hasContentType('text/html'));

Implementation

Matcher hasContentType(String type) =>
    hasHeader('content-type', contains(type));