currently this code is fetching data from the API but i am trying to figure out that how to send cookie key value pair with this api call...
as a newbie i am not able to figure out the solution any help will greatly appreciated..
Here is my code..
Future getdata(String url) async{
var data;
final response = await http.get(Uri.parse(url));
if(response.statusCode == 200 || response.statusCode == 400){
data = convert.jsonDecode(response.body);
} else {
throw Exception('Failed to connect with server');
}
return data;
}
here is a cookie value -
mid YGgv5AABAAEfUwpKKr_NQd6SCBin
ig_did 1A1B3933-7011-48B8-BA04-C19C769E91B1
ig_nrcb 1
shbid 6017
shbts 1617479398.7656476
rur NAO
csrftoken xKPVsGdKuHuffJDrgCMFHxhQPI1agWQf
ds_user_id 916506255
sessionid 9165056255%3MdvxY9kiMXXyR%3A15
I stored every keyvalue pair in database ...i can fetch any value with its key name