Ask Your Question
3

Is it impossible to access the cookie through HTTP response while using Flutter?

asked 2022-04-11 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-12-08 00:00:00 +0000

devzero gravatar image

No, it is not impossible to access cookies through HTTP response while using Flutter. You can use the http package to make HTTP requests and retrieve cookies in the response header using the headers property. Here's an example:

import 'package:http/http.dart' as http;

final response = await http.get(url);
final cookie = response.headers['set-cookie'];

This will retrieve the set-cookie header from the HTTP response and store it in the cookie variable. You can then use this cookie in subsequent HTTP requests.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-11 11:00:00 +0000

Seen: 8 times

Last updated: Dec 08 '21