headers property
The headers for any authenticated HTTP REST call to a CarpBaseService.
Implementation
Map<String, String> get headers {
if (CarpAuthService().currentUser.token == null) {
throw CarpServiceException(
message:
"OAuth token is null. Call 'CarpAuthService().authenticate()' first.");
}
return {
"Content-Type": "application/json",
"Authorization":
"bearer ${CarpAuthService().currentUser.token!.accessToken}",
"cache-control": "no-cache"
};
}