post method

Future<Response> post(
  1. String uri, {
  2. Map<String, String>? headers,
  3. Map<String, String>? queryParams,
  4. Object? body,
  5. bool cacheResult = true,
})

Performs a POST request with optional caching.

  • uri: The URI path to request (appended to baseUrl)
  • headers: Optional HTTP headers for the request
  • queryParams: Optional query parameters to add to the URL
  • body: The request body (will be JSON-encoded if it's a Map)
  • cacheResult: Whether to cache the response (default: true)

Returns a Future that completes with the Response.

Implementation

Future<http.Response> post(String uri,
    {Map<String, String>? headers,
    Map<String, String>? queryParams,
    Object? body,
    bool cacheResult = true}) async {
  return _handleRequest(
    method: REQUEST_METHODS.POST,
    uri: uri,
    headers: headers,
    queryParams: queryParams,
    body: body,
    cacheResult: cacheResult,
  );
}