Streamed responses

Responses are downloaded and printed in chunks which allows for streamingand large file downloads without using too much memory. However, whencolors and formatting is applied, the whole response is buffered and onlythen processed at once.

Disabling buffering

You can use the —stream, -S flag to make two things happen:

- The output is flushed in much smaller chunks without any buffering,which makes HTTPie behave kind of like tail -f for URLs.- Streaming becomes enabled even when the output is prettified: It will beapplied to each line of the response and flushed immediately. This makesit possible to have a nice output for long-lived requests, such as oneto the Twitter streaming API.

Examples use cases

Prettified streamed response:

  1. $ http --stream -f -a YOUR-TWITTER-NAME https://stream.twitter.com/1/statuses/filter.json track='Justin Bieber'

Streamed output by small chunks alá tail -f:

  1. # Send each new tweet (JSON object) mentioning "Apple" to another
  2. # server as soon as it arrives from the Twitter streaming API:
  3. $ http --stream -f -a YOUR-TWITTER-NAME https://stream.twitter.com/1/statuses/filter.json track=Apple \
  4. | while read tweet; do echo "$tweet" | http POST example.org/tweets ; done