Python equivalent for curl -b (--cookie)
I wish to convert a bash script that's currently using "curl -b 'coo开发者_高级运维kie'" into a Python script. I've looked at Pycurl, but I couldnt' find a -b equivalent. There are also urllib and urllib2, but I couldn't see an easy way to replicate the line.
Any help would be great.
This should get you started.
http://docs.python.org/library/cookielib.html#cookielib.CookieJar
You can use CookieJar.add_cookie_header to add your cookie to a http request header.
精彩评论