python 2.7 requests.get() returning cookie raising TypeError
Question: I'm doing a simple HTTP requests authentication vs our internal server,
getting the cookie back then hitting a Cassandra RESTful server to get data.
The requests.get() chokes when returning the cookie.

I have a curl script that extracts the data successfully, I'd rather work with
the response JSON data in pure python.

Any clues to what I've doing wrong below? I dump the cookie, it looks fine,
very similar to my curl cookie.

Craig

* * *
    
    
    import requests
    import rtim
    
    # this makes the auth and gets the cookie returned, save the cookie
    myAuth = requests.get(rtim.rcas_auth_url, auth=(rtim.username, rtim.password),verify=False)
    print myAuth.status_code
    authCookie=myAuth.headers['set-cookie']
    
    IXhost='xInternalHostName.com:9990'
    mylink='http:/%s/v1/BONDISSUE?format=JSONARRAY&issue.isin=%s' % (IXhost, 'US3133XK4V44')
    
    # chokes on next line .... doesn't like the Cookie format
    r = requests.get(mylink, cookies=authCookie)
    (Pdb) next
    TypeError: 'string indices must be integers, not str'
    


Answer: I think the problem is on the last line:

`r = requests.get(mylink, cookies=authCookie) `

requests assumes that the `cookies` parameter is a dictionary, but you are
passing a string object `authCookie` to it.

The exception raises when requests tries to treat the string `authCookie` as a
dictionary.

