headerValues method

List<String>? headerValues(
  1. String name
)

Get all values for a response header that may have multiple values.

Some headers like 'Set-Cookie' can appear multiple times. This method returns all values for such headers.

Example:

final cookies = response.headerValues('set-cookie');
expect(cookies?.length, 2);

name Header name (case-insensitive). Returns list of header values or null if header not present.

Implementation

List<String>? headerValues(String name) {
  return _response.headers[name.toLowerCase()];
}