makeGet<T extends BaseHttpResponse> method

  1. @override
Future<HttpResult<T>> makeGet<T extends BaseHttpResponse>(
  1. String path, {
  2. required T convertBodyFunc(
    1. Response
    ),
  3. Map<String, String>? headers,
  4. Map<String, String?>? queryParameters,
  5. String? bearerToken,
  6. String? clientId,
})
override

The purpose of this method is to make an HTTP /GET request.

@param path is needed to get the resources

@param convertBodyFunc has a Response as parameter to convert the information into the generic type

@param headers extra other the authentication or client_id

@param queryParameters will be added at the end of the URL

@param bearerToken is used to access to the authenticated resources

@param clientId is used to identify which application is making the requests

@return HttpResult, which contains the error or the result of the operation

Implementation

@override
Future<HttpResult<T>> makeGet<T extends BaseHttpResponse>(
  String path, {
  required T Function(http.Response) convertBodyFunc,
  Map<String, String>? headers,
  Map<String, String?>? queryParameters,
  String? bearerToken,
  String? clientId,
}) {
  return _makeRequest(
    method: HttpMethod.get,
    path: path,
    convertFunc: convertBodyFunc,
    headers: headers,
    queryParameters: queryParameters,
    bearerToken: bearerToken,
    clientId: clientId,
  );
}