diff --git a/httpx/_models.py b/httpx/_models.py index 2cc86321..7cc32073 100644 --- a/httpx/_models.py +++ b/httpx/_models.py @@ -1239,6 +1239,14 @@ class Cookies(typing.MutableMapping[str, str]): ) return f"" + + def __iadd__(self, other): + if isinstance(other, self.__class__): + self._cookies.update(other._cookies) + else: + raise ValueError("Cannot add a non-Cookies instance.") + + return self class _CookieCompatRequest(urllib.request.Request): """