post method

Future<Response?> post(
  1. String path, {
  2. dynamic data,
  3. Map<String, dynamic>? queryParameters,
  4. CancelToken? cancelToken,
  5. ProgressCallback? onSendProgress,
  6. ProgressCallback? onReceiveProgress,
  7. String contentType = Headers.formUrlEncodedContentType,
  8. String accept = ACCEPT_HEADER,
})

Implementation

Future<Response?> post(
    String path, {
      data,
      Map<String, dynamic>? queryParameters,
      CancelToken? cancelToken,
      ProgressCallback? onSendProgress,
      ProgressCallback? onReceiveProgress,
      String contentType = Headers.formUrlEncodedContentType,
      String accept = ACCEPT_HEADER,
    }) async {
  if (!checkUrl(path)) {
    return null;
  }
  Future<Response> rsp = getDioByPath(path).post(path,
      data: data,
      options: Options(
        headers: {
          HttpHeaders.acceptHeader: accept,
        },
        contentType: contentType,
      ),
      queryParameters: queryParameters,
      cancelToken: cancelToken,
      onSendProgress: onSendProgress,
      onReceiveProgress: onReceiveProgress);
  return rsp;
}