post method

Future<AlphaXResponse> post(
  1. String path, {
  2. Map<String, Object?>? queryParameters,
  3. Map<String, String>? headers,
  4. Object? data = _alphaXDataNotSupplied,
  5. AlphaXBody? body,
  6. Duration? timeout,
  7. AlphaXCancellationToken? cancellationToken,
})

Sends a POST request to path.

Supplying data creates a replayable JSON body. Use body for an explicit AlphaX body such as bytes, text, a stream, or multipart; the two parameters are mutually exclusive. Passing data: null intentionally sends the JSON value null.

Implementation

Future<AlphaXResponse> post(
  String path, {
  Map<String, Object?>? queryParameters,
  Map<String, String>? headers,
  Object? data = _alphaXDataNotSupplied,
  AlphaXBody? body,
  Duration? timeout,
  AlphaXCancellationToken? cancellationToken,
}) => _send(
  HttpMethod.post,
  path,
  queryParameters: queryParameters,
  headers: headers,
  data: data,
  body: body,
  timeout: timeout,
  cancellationToken: cancellationToken,
);