[pve-devel] [PATCH proxmox-dart-api-client 1/1] client: correctly set parameter for node actions

Dominik Csapak d.csapak at proxmox.com
Mon Apr 15 12:30:20 CEST 2024


using '?' in the url will be escaped and not used for the get
parameters. Instead add the command to the parameters map.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 lib/src/client.dart | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/src/client.dart b/lib/src/client.dart
index 447335e..f597c28 100644
--- a/lib/src/client.dart
+++ b/lib/src/client.dart
@@ -366,7 +366,9 @@ class ProxmoxApiClient extends http.BaseClient {
             '/api2/json/nodes/$targetNode/$type/$guestId/status/${action.name}';
         break;
       case 'node':
-        url = '/api2/json/nodes/$targetNode/status/?command=${action.name}';
+        parameters ??= {};
+        parameters["command"] = action.name;
+        url = '/api2/json/nodes/$targetNode/status';
         break;
       default:
         throw ArgumentError.value(
-- 
2.39.2





More information about the pve-devel mailing list