client_cookie 3.0.2 copy "client_cookie: ^3.0.2" to clipboard
client_cookie: ^3.0.2 copied to clipboard

Emulates Cookie store for dart:io and Flutter as if its a Browser. Parses cookies from 'set-cookie' response header and also writes cookies to request header.

example/client_cookie_example.dart

// Copyright (c) 2017, teja. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:client_cookie/client_cookie.dart';

main() {
  // Initializing a cookie
  final cookie1 = ClientCookie('Client', 'jaguar_resty', DateTime.now());

  // Cookie to header string
  print(cookie1.toReqHeader);

  // Encoding many cookies
  final cookie2 = ClientCookie('Who', 'teja', DateTime.now());
  print(ClientCookie.toSetCookie([cookie1, cookie2]));

  print(parseSetCookie(ClientCookie.toSetCookie([cookie1, cookie2])));
}
6
likes
120
pub points
52%
popularity

Publisher

unverified uploader

Emulates Cookie store for dart:io and Flutter as if its a Browser. Parses cookies from 'set-cookie' response header and also writes cookies to request header.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

http

More

Packages that depend on client_cookie