post<T> method

Future<T?> post<T>(
  1. String url, {
  2. Object? data,
  3. Options? options,
  4. CancelToken? cancelToken,
  5. ProgressCallback? onSendProgress,
  6. ProgressCallback? onReceiveProgress,
})

Make a POST request

Implementation

Future<T?> post<T>(
  String url, {
  Object? data,
  Options? options,
  CancelToken? cancelToken,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  if (T.toString() == 'dynamic') {
    return await network(
      request: (request) => request.postUri(Uri.parse(url),
          data: data,
          options: options,
          cancelToken: cancelToken,
          onSendProgress: onSendProgress,
          onReceiveProgress: onReceiveProgress),
    );
  }
  return await network<T>(
    request: (request) => request.postUri(Uri.parse(url),
        data: data,
        options: options,
        cancelToken: cancelToken,
        onSendProgress: onSendProgress,
        onReceiveProgress: onReceiveProgress),
  );
}