getApiHeaders method
Implementation
Map<String, String> getApiHeaders({bool isJson = false}) {
//debug("getApiHeaders token: ${_session?.token}");
var headers = <String,String>{};
// If POST or PUT methods this should be set to true
if (isJson) headers["Content-Type"] = "application/json";
// Check if we have token
if (_session != null && _session!.token != null) headers["Authorization"] = "Bearer " + _session!.token!;
return headers;
}