I use dio in my Flutter app. I have get request. I need add int array to request param. This is an example:
api/my?param1=6¶m2=5&exclude_id=[7364, 7365, 7366]
This is my code in dart:
List<int> ids = [7364, 7365, 7366]
String jsonIds = jsonEncode(ids);
final params = <String, dynamic>{
'param1': 6,
'param2': 5,
"exclude_id": jsonIds
};
final response = await _dio.get('/api/my', queryParameters: params);
but it comes to the server as (from the text log):
api/my?param1=25\u0026param2=6\u0026exclude_id=%5B7172%2C8%2C7150%2C7156%2C3848%2C7212%2C7168%2C15%2C24%2C4102%2C1032%5D
how do I add this parameter to the request correctly? any advice?