post static method

Future<Response> post(
  1. Uri uri, {
  2. Map<String, Object> body = const <String, Object>{},
  3. String token = '',
  4. Client? client,
})

Implementation

static Future<http.Response> post(Uri uri,
    {Map<String, Object> body = const <String, Object>{},
    String token = '',
    http.Client? client}) async {
  if (client == null) {
    client = http.Client();
  }
  final headers = _addAuthToken(_sendHeaders, token);
  final res = client.post(uri, body: jsonEncode(body), headers: headers);
  client.close();
  return res;
}