headers property

Map<String, String> get headers
override

The headers for any authenticated HTTP REST call to this CarpService.

Implementation

Map<String, String> get headers {
  if (_currentUser!.token == null)
    throw new CarpServiceException(
        message:
            "OAuth token is null. Call 'CarpService().authenticate()' first.");

  return {
    "Content-Type": "application/json",
    "Authorization": "bearer ${_currentUser!.token!.accessToken}",
    "cache-control": "no-cache"
  };
}