checkResponse static method
Checks the response of the api call and returns the body, it throws a MBException if it encounters an error.
- Parameters:
response
: Theresponse
string that needs to be checked.checkBody
: Iftrue
this function checks if in the response there's a "body" value, otherwise it skips this check,true
by default.
- Returns a Map<String, dynamic> object which is the body of the response.
Implementation
static Map<String, dynamic> checkResponse(
String response, {
bool checkBody = true,
}) =>
checkResponseForType<Map<String, dynamic>>(
response,
checkBody: checkBody,
);