httpPost static method

Future httpPost(
  1. Uri url, {
  2. Map<String, dynamic>? body,
})

HTTP post method (x-www-form-urlencoded) url - request url (required) body - parameters in map

Implementation

static Future<dynamic> httpPost(Uri url, {Map<String, dynamic>? body}) async {
  body?.removeWhere(_nullFilter);
  return http
      .post(url, body: body?.map((k, v) => MapEntry(k, '$v')))
      .then(_parseResponse)
      .catchError((error) => Future.error(error));
}