sendFormEncodedRequest abstract method
Sends an HTTP request with form URL-encoded parameters.
This method supports different HTTP methods (default is POST) and
sends the request body as application/x-www-form-urlencoded
.
Parameters:
endPoint
: The URL endpoint to which the request is sent.param
: A map of key-value pairs to be sent as form data in the request body.headers
: A map of HTTP headers to include in the request.method
: The HTTP method to use for the request (default is POST).
Returns:
A Future
that completes with the decoded response data or an error.
Example:
final response = await sendFormEncodedRequest(
endPoint: 'https://example.com/api/login',
param: {'username': 'user', 'password': 'pass'},
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
method: IDSMethodType.post,
);
Implementation
Future<dynamic> sendFormEncodedRequest({
required String endPoint,
required Map<String, dynamic> param,
required Map<String, dynamic> headers,
IDSMethodType method = IDSMethodType.post,
});