diff --git a/lib/src/client.dart b/lib/src/client.dart index d07fca9..02222c0 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -334,6 +334,7 @@ class ProffixClient implements BaseProffixClient { Future put({ String endpoint = '', Map? data, + Map? params, }) async { // return await call('post', path: path, headers: headers, data: data); String pxsessionid = await getPxSessionId(); @@ -342,11 +343,15 @@ class ProffixClient implements BaseProffixClient { _dioClient.options.headers['PxSessionId'] = pxsessionid; try { + /// + + final postUri = _getUriUrl( + buildUriPx(restURL, [_options.apiPrefix, _options.version, endpoint]) + .toString(), + params); + var resp = await _dioClient - .put( - buildUriPx( - restURL, [_options.apiPrefix, _options.version, endpoint]), - data: json.encode(data)) + .put(postUri, data: json.encode(data)) .timeout(Duration(seconds: _options.timeout)); if (resp.statusCode == null || (resp.statusCode! < 200 || resp.statusCode! > 300)) { diff --git a/lib/src/client_base.dart b/lib/src/client_base.dart index 943ea91..095bf0e 100644 --- a/lib/src/client_base.dart +++ b/lib/src/client_base.dart @@ -37,10 +37,10 @@ abstract class BaseProffixClient { }); /// An alias of ProffixClient.call('put') - Future put({ - required String endpoint, - Map? data, - }); + Future put( + {required String endpoint, + Map? data, + Map? params = const {}}); /// An alias of ProffixClient.call('delete') Future delete({ diff --git a/pubspec.yaml b/pubspec.yaml index a663aed..b51835f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_proffix_rest description: A Dart wrapper for Proffix Rest API with automatic login and logout and many useful helper functions -version: 0.3.5 +version: 0.3.6 repository: https://github.com/pitwch/dart_proffix_rest homepage: https://github.com/pitwch/dart_proffix_rest environment: