def build_cookie_header(
    cookiejar: CookieJar, url: str, headers: Mapping[str, str]
) -> None | str:
    """Build HTTP Cookie header value for given cookies."""
    mocked_req = MockRequest(url, dict(headers))
    cookiejar.add_cookie_header(cast(urllib.request.Request, mocked_req))
    return mocked_req.get_new_headers().get("Cookie")
Build HTTP Cookie header value for given cookies.
grab/util/cookies.py