httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Added __iadd__ magic method to Cookies class

Open ZakariaMQ opened this issue 1 year ago • 0 comments
trafficstars

Summary

I have added iadd magic method to the Cookies class Now we got a new interface to update cookies rather than the update method

simple usage

from httpx import Cookies, get

cookies = Cookies()
r = httpx.get('example.com")
cookies += r.cookies
print(cookies)

Now 'cookies' contains the cookies from the response 'r' You can use 'cookies' in subsequent requests

ZakariaMQ avatar Mar 03 '24 14:03 ZakariaMQ