post<T> method

Future<XRPCResponse<T>> post<T>(
  1. NSID methodId, {
  2. String? service,
  3. Map<String, String>? headers,
  4. Map<String, dynamic>? parameters,
  5. dynamic body,
  6. ResponseDataBuilder<T>? to,
  7. PostClient? client,
})

Implementation

Future<xrpc.XRPCResponse<T>> post<T>(
  final NSID methodId, {
  final String? service,
  final Map<String, String>? headers,
  final Map<String, dynamic>? parameters,
  final dynamic body,
  final xrpc.ResponseDataBuilder<T>? to,
  final xrpc.PostClient? client,
}) async {
  await _maybeRefreshBeforeSend();

  return await _challenge.execute(
    () async => await xrpc.procedure(
      methodId,
      protocol: _protocol,
      service: service ?? this.service,
      headers: {..._headers ?? const {}, ...headers ?? const {}},
      parameters: parameters,
      body: body,
      to: to,
      timeout: _timeout,
      headerBuilder: _buildAuthHeader,
      postClient: client ?? _postClient,
    ),
    onUpdateDpopNonce: _onUpdateDpopNonce,
    onUnauthorized: _onUnauthorized,
  );
}