http_session 0.0.3
http_session: ^0.0.3 copied to clipboard
Easier to manage the sessions when using http to requests.
Http Session #
If you want to login to a web service and keep comunicate with it, you need to save the session and use it for all the requests. This plugin will help you to do that.
Features #
Create an instance of http and manage the session.
Usage #
Use shared session across the application
final httpSession = HttpSession.shared;
Or create a new session instance
final httpSession = HttpSession();
Now you can requests any URI and the plugin will automatically save the session.
final response = await httpSession.post(url, body: data);
final response = await httpSession.get(url);
Clear the current session
httpSession.clear();
Close the current http and also clear the session
httpSession.close();
Get current session headers:
final headers = httpSession.headers;