Skip to content

Commit

Permalink
Custom input parameters for dio post method
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Oct 1, 2024
1 parent f55a186 commit d2d294e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/jmap/jmap_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ class JmapRequest {
RequestObject? _requestObject;
RequestObject? get requestObject => _requestObject;

Future<ResponseObject> execute({CancelToken? cancelToken}) async {
Future<ResponseObject> execute({
Map<String, dynamic>? queryParameters,
Options? options,
CancelToken? cancelToken,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
_requestObject = (RequestObject.builder()
..usings(_capabilities.asSet())
..methodCalls(_invocations.values.toList()))
Expand All @@ -30,7 +36,11 @@ class JmapRequest {
return _httpClient.post(
'',
data: _requestObject?.toJson(),
cancelToken: cancelToken
queryParameters: queryParameters,
options: options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
)
.then(extractData)
.catchError((error) => throw error);
Expand Down

0 comments on commit d2d294e

Please sign in to comment.