diff --git a/clients/algoliasearch-client-dart/packages/client_core/lib/src/transport/dio/dio_requester.dart b/clients/algoliasearch-client-dart/packages/client_core/lib/src/transport/dio/dio_requester.dart index a64a362b7d..d9f9191c02 100644 --- a/clients/algoliasearch-client-dart/packages/client_core/lib/src/transport/dio/dio_requester.dart +++ b/clients/algoliasearch-client-dart/packages/client_core/lib/src/transport/dio/dio_requester.dart @@ -99,20 +99,17 @@ class DioRequester implements Requester { } /// Constructs the request URI from the [request] details. - Uri requestUri(HttpRequest request) { - Uri uri = Uri( - scheme: request.host.scheme, - host: request.host.url, - port: request.host.port, - path: request.path, - ); - if (request.queryParameters.isNotEmpty) { - return Uri.dataFromString( - "${uri.toString()}?${request.queryParameters.entries.map((e) => "${e.key}=${e.value}").join("&")}"); - } - - return uri; - } + Uri requestUri(HttpRequest request) => Uri( + scheme: request.host.scheme, + host: request.host.url, + port: request.host.port, + path: request.path, + query: request.queryParameters.isNotEmpty + ? request.queryParameters.entries + .map((e) => "${e.key}=${e.value}") + .join("&") + : null, + ); @override void close() => _client.close();