call method
Implementation
@override
Future<Response<dynamic>> call(
HttpMethod method, {
String path = '',
Map<String, String> headers = const {},
Map<String, dynamic> params = const {},
ResponseType? responseType,
}) async {
late http.Response res;
final http.BaseRequest request = prepareRequest(
method,
uri: Uri.parse(_endPoint + path),
headers: {..._headers!, ...headers},
params: params,
);
try {
final streamedResponse = await _httpClient
.send(request)
.timeout(const Duration(seconds: 120));
res = await toResponse(streamedResponse);
return prepareResponse(
res,
responseType: responseType,
);
} catch (e) {
if (e is TombaException) {
rethrow;
}
throw TombaException(e.toString());
}
}