Merge branch 'master' into fatima

fatima
Fatimah Alshammari 4 years ago
commit 0ffe8a949a

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

Loading…
Cancel
Save