dio_cookie_manager 1.0.0
dio_cookie_manager: ^1.0.0 copied to clipboard

Dart native
Flutter Android iOS Linux macOS Windows

A cookie manager for Dio, which supports persistent cookies in RAM and file.

example/example.dart

import 'package:dio/dio.dart';
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
import 'package:cookie_jar/cookie_jar.dart';

main() async {
  var dio =  Dio();
  var cookieJar=CookieJar();
  dio.interceptors.add(CookieManager(cookieJar));
  await dio.get("https://baidu.com/");
  // Print cookies
  print(cookieJar.loadForRequest(Uri.parse("https://baidu.com/")));
  // second request with the cookie
  await dio.get("https://baidu.com/");
}
23
likes
100
pub points
95%
popularity

Publisher

flutterchina.club

A cookie manager for Dio, which supports persistent cookies in RAM and file.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

cookie_jar, dio

More

Packages that depend on dio_cookie_manager