httr (version 1.1.0)

write_stream: Process output in a streaming manner.

Description

This is the most general way of processing the response from the server - you receive the raw bytes as they come in, and you can do whatever you want with them.

Usage

write_stream(f)

Arguments

f
Callback function. It should have a single argument, a raw vector containing the bytes recieved from the server. This will usually be 16k or less. It should return the length of bytes processed - if this is less than the input length, the function will te

Examples

Run this code
GET("https://jeroenooms.github.io/data/diamonds.json",
  write_stream(function(x) {
   print(length(x))
   length(x)
 })
)

Run the code above in your browser using DataLab