The cookie in python is different from that in header.

is when passing cookie
headers= {"cookies":self.cookies,"user-agent": * *}
res=request.get (url=url,headers=headers)

this is the first way to write

there is another
cookie_str=cookies
headers= {"user-agent": * *}
cookies=dict (cookies)
res=request.get (url=url,headers=headers,cookies=cookie_str)

this is the second way to write. What"s the difference between the two?
print (res.text)

Jan.20,2022

No matter how the form changes to the end, it will be sent in the form of a http message.
cookie will be converted to the cookie attribute in header


it doesn't feel different. It should be the two ways of writing get
. The cookie_str, of the second way seems to be useless

.
Menu