headersForQuery method

  1. @protected
Map<String, String> headersForQuery([
  1. Query? query
])

Expand a query into HTTP headers

Implementation

@protected
Map<String, String> headersForQuery([Query? query]) {
  if ((query == null || query.providerArgs['headers'] == null) && defaultHeaders != null) {
    return defaultHeaders!;
  }

  return {}
    ..addAll({'Content-Type': 'application/json'})
    ..addAll(defaultHeaders ?? <String, String>{})
    ..addAll(query?.providerArgs['headers'] ?? <String, String>{});
}