connectCoreV1PostNodeProxy method

Future<String> connectCoreV1PostNodeProxy({
  1. required String body,
  2. required String name,
  3. String? pathQuery,
})

Connect POST requests to proxy of Node.

name Name of the NodeProxyOptions.

pathQuery Path is the URL path to use for the current proxy request to node.

Implementation

Future<String> connectCoreV1PostNodeProxy({
  required String body,
  required String name,
  String? pathQuery,
}) async {
  final queryStrings = <String, Object>{};
  if (pathQuery != null) {
    queryStrings['path'] = pathQuery;
  }

  final query =
      queryStrings.isEmpty ? '' : '?${_joinQueryStrings(queryStrings)}';

  final result =
      await _postJsonString('/api/v1/nodes/$name/proxy$query', body);
  return result;
}