dio_cookie_manager 3.1.1 copy "dio_cookie_manager: ^3.1.1" to clipboard
dio_cookie_manager: ^3.1.1 copied to clipboard

A cookie manager combines cookie_jar and dio, based on the interceptor algorithm.

example/example.dart

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

void main() async {
  final dio = Dio();
  final 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/');
}
145
likes
160
points
52.6k
downloads

Publisher

verified publisherflutter.cn

Weekly Downloads

A cookie manager combines cookie_jar and dio, based on the interceptor algorithm.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#dio #cookie #network #storage #persistence

Documentation

API reference

License

MIT (license)

Dependencies

cookie_jar, dio

More

Packages that depend on dio_cookie_manager