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