makePost<T extends BaseHttpResponse> method
Future<HttpResult<T> >
makePost<T extends BaseHttpResponse>(
- String path, {
- required T convertBodyFunc(
- Response p1
- Map<
String, String> ? headers, - Map<
String, String?> ? queryParameters, - Map<
String, dynamic> ? body, - String? bearerToken,
- String? clientId,
override
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
@override
Future<HttpResult<T>> makePost<T extends BaseHttpResponse>(
String path, {
required T Function(http.Response p1) convertBodyFunc,
Map<String, String>? headers,
Map<String, String?>? queryParameters,
Map<String, dynamic>? body,
String? bearerToken,
String? clientId,
}) {
return _makeRequest(
method: HttpMethod.post,
path: path,
convertFunc: convertBodyFunc,
headers: headers,
queryParameters: queryParameters,
bearerToken: bearerToken,
clientId: clientId,
body: body,
);
}