makePost<T extends BaseHttpResponse> abstract method

Future<HttpResult<T>> makePost<T extends BaseHttpResponse>(
  1. String path, {
  2. required T convertBodyFunc(
    1. Response response
    ),
  3. Map<String, String>? headers,
  4. Map<String, String?>? queryParameters,
  5. Map<String, dynamic>? body,
  6. String? bearerToken,
  7. String? clientId,
})

The purpose of this method is to make an HTTP /POST 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 body is added inside the request as application/json format

@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

Future<HttpResult<T>> makePost<T extends BaseHttpResponse>(
  String path, {
  required T Function(http.Response response) convertBodyFunc,
  Map<String, String>? headers,
  Map<String, String?>? queryParameters,
  Map<String, dynamic>? body,
  String? bearerToken,
  String? clientId,
});