applyHeader function

Request applyHeader (
  1. Request request,
  2. String name,
  3. String value,
  4. {bool override: true}
)

Apply value to the header field name of the request if override is true, it will erase already present headers with the new value

final newRequest = applyHeader(request, 'foo', 'bar');

Implementation

Request applyHeader(
  Request request,
  String name,
  String value, {
  bool override = true,
}) =>
    applyHeaders(
      request,
      {name: value},
      override: override,
    );