beforeRequestAddCookies function

BeforeRequestCallback beforeRequestAddCookies(
  1. List<Cookie> getCookies()
)

Creates BeforeRequestCallback that dynamically adds Cookies to requests.

Implementation

BeforeRequestCallback beforeRequestAddCookies(List<Cookie> Function() getCookies) =>
  (request) => request
    ..headers['cookie'] = getCookies().map((e) => e.toString()).join('; ');