Ideally, we should tell the server that we can process gzipped content, find out from the HTTP headers that the content is actually gzip encoded, and then unpack it only if it exists. The Rcurl library can do this:
library(Rcurl) getURL("http://api.stackoverflow.com/0.9/stats/", .opts=list(encoding="identity,gzip")
Jyotirmoy bhattacharya
source share