How do you correctly add this kind of query parameters to a Dart http get request. This is my code
String? token;
String? baseUrl = 'vps';
String? path = 'web/session';
Map<String, dynamic> query ={
"jsonrpc": "1.0",
"method": "call",
"id": "2",
"params": {
"login": username,
"password": password,
"db": "dev.sf.com",
"context": {}
}
};
Uri uri = Uri.http(baseUrl.toString(), '$path/$endPath');
if (query != null) {
uri = Uri.http(baseUrl.toString(), '$path/$endPath', query);
}
return http.get(uri, headers: {
'Authorization': 'Bearer $token',
'Accept': 'application/json',
});
but i get this error
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: type '_InternalLinkedHashMap<String, Object>' is not a subtype of type 'Iterable<dynamic>'