503 from Twitter when following "too many" user IDs with streaming API
Whenever I attempt to follow too many user IDs with statuses/filter (streaming API), I consistently get back a 503 error from Twitter. (Note: I am keeping the number below Twitter's maximum of 5,000 IDs.) The magic number at which it becomes "too many" IDs is 3,272. As soon as I pass 3,273 or more user IDs, I get back a 503.
I figured this was an issue with Twitter's API. But then I used twurl to make the same request, with 5,000 IDs, and it worked flawlessly. (I tested with 5,001 IDs, just to make sure, and got back the expected 413 Request Entity Too Large.)
What could be happening?
Update: I run into the exact same issue when using a different Twitter library, twit -- it errors out when I pass >= 3,273 IDs to follow.
I notice both libraries use Request. Could it have something to do with the way Request is formatting the request?
cc: @ttezel
I tried to duplicate this today in node-twitter, and got similar behavior. For me the "magic number" was somewhere between 2100 and 2150.
That's probably because the IDs are sent in the URL as parameters, instead of the POST body.
twitter-lite handles this correctly. Here's a test.