MCPcopy
hub / github.com/encode/httpx / _merge_cookies

Method _merge_cookies

httpx/_client.py:413–422  ·  view source on GitHub ↗

Merge a cookies argument together with any cookies on the client, to create the cookies used for the outgoing request.

(self, cookies: CookieTypes | None = None)

Source from the content-addressed store, hash-verified

411 return merge_url
412
413 def _merge_cookies(self, cookies: CookieTypes | None = None) -> CookieTypes | None:
414 """
415 Merge a cookies argument together with any cookies on the client,
416 to create the cookies used for the outgoing request.
417 """
418 if cookies or self.cookies:
419 merged_cookies = Cookies(self.cookies)
420 merged_cookies.update(cookies)
421 return merged_cookies
422 return cookies
423
424 def _merge_headers(self, headers: HeaderTypes | None = None) -> HeaderTypes | None:
425 """

Callers 1

build_requestMethod · 0.95

Calls 2

updateMethod · 0.95
CookiesClass · 0.85

Tested by

no test coverage detected