header method

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

Sets a single custom HTTP header

Implementation

HttpConfig header(String name, String value) {
  final existingHeaders =
      _config['customHeaders'] as Map<String, String>? ?? <String, String>{};
  _config['customHeaders'] = {...existingHeaders, name: value};
  return this;
}