RestHeaders typedef
RestHeaders =
Future<Map<String, String> > Function(RestRequest request)
Builds the headers every call carries.
Called once per request, so it can read a credential that has just been renewed, sign a payload, or stamp a request identifier. Whatever it returns is merged under RestRequest.headers, which therefore always wins.
Nothing about authentication is assumed here: an adapter that sends
Authorization: Bearer writes that, one that sends an API key header writes
that instead.
Implementation
typedef RestHeaders = Future<Map<String, String>> Function(RestRequest request);