I\'d like to make an http request to a remote server while properly handling cookies (eg. storing cookies sent by the server, and sending those cookies when I make subsequen
I've published a small flutter library called requests to assist with cookie-aware http requests.
dependencies:
requests: ^3.0.1
Usage:
import 'package:requests/requests.dart';
// ...
// this will persist cookies
var r1 = await Requests.post("https://example.com/api/v1/login", json: {"username":"...", "password":"..."} );
r1.raiseForStatus();
// this will re-use the persisted cookies
var r2 = await Requests.get("https://example.com/api/v1/stuff");
r2.raiseForStatus();
print(r2.json()['id'])
find out more about requests