beforeRequestAddCookiesStatic function

BeforeRequestCallback beforeRequestAddCookiesStatic(
  1. List<Cookie> cookies
)

Creates BeforeRequestCallback that adds static list of Cookies to requests.

Implementation

BeforeRequestCallback beforeRequestAddCookiesStatic(List<Cookie> cookies) {
  final _cookies = cookies.map((e) => e.toString()).join('; ');
  return (request) => request
    ..headers['cookie'] = _cookies;
}