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

Method clear

httpx/_models.py:1192–1203  ·  httpx/_models.py::Cookies.clear

Delete all cookies. Optionally include a domain and path in order to only delete a subset of all the cookies.

(self, domain: str | None = None, path: str | None = None)

Source from the content-addressed store, hash-verified

1190 self.jar.clear(cookie.domain, cookie.path, cookie.name)
1191
1192 def clear(self, domain: str | None = None, path: str | None = None) -> None:
1193 class="st">"""
1194 Delete all cookies. Optionally include a domain and path in
1195 order to only delete a subset of all the cookies.
1196 class="st">"""
1197 args = []
1198 if domain is not None:
1199 args.append(domain)
1200 if path is not None:
1201 assert domain is not None
1202 args.append(path)
1203 self.jar.clear(*args)
1204
1205 def update(self, cookies: CookieTypes | None = None) -> None: class="cm"># type: ignore
1206 cookies = Cookies(cookies)

Callers 5

test_cookies_with_domainFunction · 0.95
deleteMethod · 0.80
clean_environFunction · 0.80
watch_restartsMethod · 0.80

Calls

no outgoing calls

Tested by 4

test_cookies_with_domainFunction · 0.76
clean_environFunction · 0.64
watch_restartsMethod · 0.64