MCPcopy Index your code
hub / github.com/encode/httpx / set

Method set

httpx/_models.py:1117–1141  ·  view source on GitHub ↗

Set a cookie value by name. May optionally include domain and path.

(self, name: str, value: str, domain: str = "", path: str = "/")

Source from the content-addressed store, hash-verified

1115 self.jar.add_cookie_header(urllib_request)
1116
1117 def set(self, name: str, value: str, domain: str = "", path: str = "/") -> None:
1118 """
1119 Set a cookie value by name. May optionally include domain and path.
1120 """
1121 kwargs = {
1122 "version": 0,
1123 "name": name,
1124 "value": value,
1125 "port": None,
1126 "port_specified": False,
1127 "domain": domain,
1128 "domain_specified": bool(domain),
1129 "domain_initial_dot": domain.startswith("."),
1130 "path": path,
1131 "path_specified": bool(path),
1132 "secure": False,
1133 "expires": None,
1134 "discard": True,
1135 "comment": None,
1136 "comment_url": None,
1137 "rest": {"HttpOnly": None},
1138 "rfc2109": False,
1139 }
1140 cookie = Cookie(**kwargs) # type: ignore
1141 self.jar.set_cookie(cookie)
1142
1143 def get( # type: ignore
1144 self,

Callers 9

__init__Method · 0.95
__setitem__Method · 0.95
test_cookies_updateFunction · 0.95
test_cookies_with_domainFunction · 0.95
test_cookies_reprFunction · 0.95
sendMethod · 0.45
handle_async_requestMethod · 0.45
restartMethod · 0.45

Calls

no outgoing calls

Tested by 5

test_cookies_updateFunction · 0.76
test_cookies_with_domainFunction · 0.76
test_cookies_reprFunction · 0.76
restartMethod · 0.36