how can I add set-cookie in Headers of Flutter API. I've used the following dart plugin:
I am following these links but couldn't add headers.
Below is my Code:
Future<Map> getApi() async {
Map<String, String> headers = {};
// HEADERS TO BE ADDED
headers['Set-Cookie'] = "user_image=; Path=/";
headers['Set-Cookie'] = "user_id=Administrator; Path=/";
headers['Set-Cookie'] = "system_user=yes; Path=/";
headers['Set-Cookie'] = "full_name=Administrator; Path=/";
headers['Set-Cookie'] = "sid=123456789; Expires=Mon, 25-Feb-2019 11:01:39 GMT; Path=/";
// API RESPONSE
http.Response response = await http.get(
apiUrl,
headers: headers,
);
// CONVERT TO JSON AND MAP
Map responseBody = convert.jsonDecode(response.body);
return responseBody;
}