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.
write_stream(f)
| 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. The return value of the function is ignored. |
|---|
GET( "https://github.com/jeroen/data/raw/gh-pages/diamonds.json", write_stream(function(x) { print(length(x)) length(x) }) )#> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 5261 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 2297 #> [1] 24182 #> [1] 24274 #> [1] 23729 #> [1] 32768 #> [1] 2877 #> [1] 23374 #> [1] 23328 #> [1] 23953 #> [1] 32768 #> [1] 2987 #> [1] 32768 #> [1] 3170 #> [1] 32768 #> [1] 2514 #> [1] 32768 #> [1] 15007 #> [1] 32768 #> [1] 25970 #> [1] 32768 #> [1] 2130 #> [1] 32768 #> [1] 26621 #> [1] 32768 #> [1] 26723 #> [1] 32768 #> [1] 14396 #> [1] 32768 #> [1] 3492 #> [1] 32768 #> [1] 32768 #> [1] 18109 #> [1] 32768 #> [1] 32768 #> [1] 5950 #> [1] 32768 #> [1] 32768 #> [1] 6744 #> [1] 23877 #> [1] 32768 #> [1] 32768 #> [1] 19584 #> [1] 32768 #> [1] 32768 #> [1] 30577 #> [1] 32768 #> [1] 32768 #> [1] 6057 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 10257 #> [1] 32768 #> [1] 2877 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 20890 #> [1] 32768 #> [1] 25949 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 8651 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 30189 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 8213 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 5626 #> [1] 32768 #> [1] 24646 #> [1] 32768 #> [1] 32768 #> [1] 25303 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 28509 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 15633 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 25980 #> [1] 32768 #> [1] 10578 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 24463 #> [1] 32768 #> [1] 32768 #> [1] 10476 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 23654 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32275 #> [1] 32768 #> [1] 32768 #> [1] 22480 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 30891 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 32768 #> [1] 5984#> Response [https://raw.githubusercontent.com/jeroen/data/gh-pages/diamonds.json] #> Date: 2020-08-17 22:23 #> Status: 200 #> Content-Type: text/plain; charset=utf-8 #> <EMPTY BODY>