uploadFormData method
Uploads form data, including a file, to the server.
This method allows sending form data along with a file to the specified API endpoint and processes the request asynchronously.
endPoint
- The API endpoint to which the request is sent.
params
- The parameters to include in the request body.
filePath
- The path of the file to be uploaded.
headers
- The request headers to send with the request.
Returns a Future containing a Map<String, dynamic> that represents the response from the API.
Implementation
@override
/// Uploads form data, including a file, to the server.
///
/// This method allows sending form data along with a file
/// to the specified API endpoint and processes the request asynchronously.
///
/// [endPoint] - The API endpoint to which the request is sent.
/// [params] - The parameters to include in the request body.
/// [filePath] - The path of the file to be uploaded.
/// [headers] - The request headers to send with the request.
///
/// Returns a [Future] containing a [Map<String, dynamic>]
/// that represents the response from the API.
Future<Map<String, dynamic>> uploadFormData(
String endPoint,
Map<String, dynamic> params,
String filePath,
Map<String, dynamic> headers) async {
return _uploadFormData(endPoint, params, filePath, headers);
}