|
|
|
@ -68,12 +68,12 @@ class ApiClient {
|
|
|
|
|
var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes);
|
|
|
|
|
try {
|
|
|
|
|
if (!kReleaseMode) {
|
|
|
|
|
print("res:"+response.body);
|
|
|
|
|
print("res:" + response.body);
|
|
|
|
|
}
|
|
|
|
|
var jsonData = jsonDecode(response.body);
|
|
|
|
|
return factoryConstructor(jsonData);
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
print("exception:"+response.body);
|
|
|
|
|
print("exception:" + response.body);
|
|
|
|
|
throw APIException(APIException.BAD_RESPONSE_FORMAT, arguments: ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -109,10 +109,9 @@ class ApiClient {
|
|
|
|
|
}
|
|
|
|
|
var response = await _post(Uri.parse(url), body: requestBody, headers: _headers).timeout(Duration(seconds: 100));
|
|
|
|
|
if (!kReleaseMode) {
|
|
|
|
|
|
|
|
|
|
print("Url:$url");
|
|
|
|
|
print("body:$requestBody");
|
|
|
|
|
print("res: "+ response.body);
|
|
|
|
|
print("res: " + response.body);
|
|
|
|
|
}
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 500) {
|
|
|
|
|
return response;
|
|
|
|
|