sendRequest abstract method

Future sendRequest({
  1. required String endPoint,
  2. required Map<String, dynamic> param,
  3. required Map<String, dynamic> headers,
  4. IDSMethodType method = IDSMethodType.post,
})

Sends an HTTP request to the specified endPoint with given param and headers.

This method supports different request methods defined by IDSMethodType, with the default being post. It returns a Future that resolves to the dynamic response data from the server.

  • endPoint: The URL path or endpoint to which the request is sent.
  • param: The body or query parameters to be included in the request.
  • headers: Custom headers such as authorization tokens or content types.
  • method: Type of HTTP method (GET, POST, etc.) defined in IDSMethodType. Default is POST.

Returns a Future containing the response data, or throws an error if the request fails.

Implementation

Future<dynamic> sendRequest({
  required String endPoint,
  required Map<String, dynamic> param,
  required Map<String, dynamic> headers,
  IDSMethodType method = IDSMethodType.post,
});