How do you correctly add query parameters to a Dart http get request? I been unable to get my request to respond correctly when trying to append the \'?param1=one¶m
If you dont want to override the scheme of base endpoint url, use the below technique to convert the map to query string and append it to the base endpoint url
var endpointUrl = 'https://www.myurl.com/api/v1/user';
Map queryParams = {
'param1': '1',
'param2': '2'
};
String queryString = Uri(queryParameters: queryParams).query;
var requestUrl = endpointUrl + '?' + queryString; // result - https://www.myurl.com/api/v1/user?param1=1¶m2=2
var response = await http.get(requestUrl);