i would like to transform a curl get request into http request using the dart language, the curl code is there :
and here is the code i have tried to implement, it doesn't take all parameters :
import 'package:http/http.dart' as http;
void main() async {
var params = {
'ad_format': 'DESKTOP_FEED_STANDARD',
'access_token': '<ACCESS_TOKEN>',
};
var query = params.entries.map((p) => '${p.key}=${p.value}').join('&');
var res = await http.get('https://graph.facebook.com/v2.11/act_AD_ACCOUNT_ID/generatepreviews?$query');
if (res.statusCode != 200) throw Exception('http.get error: statusCode=${res.statusCode}');
print(res.body);
}