header method

TestRequest header(
  1. String name,
  2. String value
)

Set a single HTTP header for the request.

Example:

testApp.get('/api/data')
  .header('Accept', 'application/json')
  .header('X-API-Key', 'secret-key');

name Header name (case-insensitive). value Header value. Returns this request builder for method chaining.

Implementation

TestRequest header(String name, String value) {
  _headers[name] = value;
  return this;
}