Should I expect an array or a dictionary?


Should I expect an array or dictionary when issuing a “GET” to
I’m currently using Application-only authentication, and successfully returning a bearer token and receiving a json response from twitter. But some requests return NSCFArrays and others return NSCFDictionarys. Shouldn’t it be consistently one or the other?


The API itself returns a JSON array when the request can be served with a result set. There are conditions like rate limiting, a user not being found, or other visibility problems that would result in a HTTP 404, 401, 429, etc – in that case the response would be a JSON hash describing the error. You should monitor HTTP status codes to determine whether the response you got contains the data you’re looking for or not.