post method
Future<Response?>
post(
- String path, {
- dynamic data,
- Map<String, dynamic>? queryParameters,
- CancelToken? cancelToken,
- ProgressCallback? onSendProgress,
- ProgressCallback? onReceiveProgress,
- String contentType = Headers.formUrlEncodedContentType,
- 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;
}