post method

Future<Response> post(
  1. dynamic url, {
  2. Map<String, String>? headers,
  3. Map<String, dynamic>? params,
  4. Object? body,
  5. Encoding? encoding,
})

Performs a POST request with a new Client instance and closes it after it has been used.

Implementation

Future<Response> post(
  url, {
  Map<String, String>? headers,
  Map<String, dynamic>? params,
  Object? body,
  Encoding? encoding,
}) async {
  return _withClient((client) => client.post(
        url,
        headers: headers,
        params: params,
        body: body,
        encoding: encoding,
      ));
}