Notice that request() accepts both REST and Streaming API methods, and it takes two arguments: 1) the Twitter method, 2) a dictionary of method parameters. In the above examples we use the get\_iterator() helper to get each tweet object. This iterator knows how to iterate both REST and Streaming API results, in addition to error objects. Alternatively, you have access to the response object returned by request(). From the response object you may call properties that return the raw response (r.text) and the http status code (r.status\_code). See the documentation for the [Requests]http://docs.python-requests.org/en/latest/user/quickstart/ library for more info.

Command-Line Usage cli.py)---------------------------For syntax help:

> python -u -m TwitterAPI.cli -h

You will need to supply your Twitter application OAuth credentials. The easiest option is to save them in TwitterAPI/credentials.txt. It is the default place where cli.py will look for them. You also may supply an alternative credentials file as a command-line argument.

After the -field option you must supply one or more key names from the raw JSON response object. This will print values only for these keys. When the -field option is omitted cli.py prints the entire JSON response object.