postJson method

Future<HttpResponse> postJson(
  1. PeerId peerId,
  2. String path,
  3. Map<String, dynamic> data
)

Implementation

Future<HttpResponse> postJson(PeerId peerId, String path, Map<String, dynamic> data) {
  final body = utf8.encode(jsonEncode(data));
  final headers = {'content-type': 'application/json'};
  return request(peerId, HttpMethod.post, path, headers: headers, body: body);
}