Hi @episod,
The headers:
(Pdb) p resp.getheaders()
[('content-length', '1285'), ('server', 'Jetty(6.1.25)'), ('content-type', 'text/html; charset=iso-8859-1'), ('www-authenticate', 'Basic realm="Firehose"'), ('cache-control', 'must-revalidate,no-cache,no-store')]
The content:
Error 401 UNAUTHORIZED
HTTP ERROR: 401
Problem accessing /2/user.json. Reason:
UNAUTHORIZED
Powered by Jetty://
The client is tweepy. I’m not sure, but the relevant code just uses plain httplib:
if self.scheme == "http":
conn = httplib.HTTPConnection(self.host)
else:
conn = httplib.HTTPSConnection(self.host) # i've been invoking this path
self.auth.apply_auth(url, 'POST', self.headers, self.parameters)
conn.connect()
conn.sock.settimeout(self.timeout)
conn.request('POST', self.url, self.body, headers=self.headers)
resp = conn.getresponse()
That said, the resp object seems to have a ‘_read_chunked’ method:
(Pdb) p resp
(Pdb) dir(resp)
['__doc__', '__init__', '__module__', '_check_close', '_method', '_read_chunked', '_read_status', '_safe_read', 'begin', 'chunk_left', 'chunked', 'close', 'debuglevel', 'fp', 'getheader', 'getheaders', 'isclosed', 'length', 'msg', 'read', 'reason', 'status', 'strict', 'version', 'will_close']
I know that the access tokens I’m using had worked for a while before they suddenly stopped working without explanation. I also know that I continue to be able to use them fine for the REST API, which I’m using like so from tweepy (note that this reuses the same load_auth() as the streaming code snippet from my first post):
auth = load_auth()
api = tweepy.API(auth)
On the REST API, I have been using methods for which auth is optional, but (1) I would not be able to make as many calls if I wasn’t authenticated (I used to make public calls before I quickly hit the rate ceiling), and (2) just now I tried with a method for which auth is required (/blocks/blocking):
In [2]: api.api.blocks()
Out[2]:
[,
,
,
,
,
,
...
Please let me know if you require any further information. Thanks in advance for any help.