httr 1.1.0 (and 1.0.0)

[This article was first published on RStudio Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

httr 1.1.0 is now available on CRAN. The httr packages makes it easy to talk to web APIs from R. Learn more in the quick start vignette.

Install the latest version with:

install.packages("devtools")

When writing this blog post I discovered that I forgot to annouce httr 1.0.0. This was a major release marking the transition from the RCurl package to the curl package, a modern binding to libcurl written by Jeroen Ooms. This makes httr more reliable, less likely to leak memory, and prevents the diabolical “easy handle already used in multi handle” error.

httr 1.1.0 includes a couple of new features:

  • stop_for_status(), warn_for_status() and (new) message_for_status() replace the old message argument with a new task argument that optionally describes the current task. This allows API wrappers to provide more informative error messages on failure.
  • http_error() replaces url_ok() and url_successful(). http_error() more clearly conveys intent and works with urls, responses and status codes.

Otherwise, OAuth support continues to improve thanks to support from the community:

  • Nathan Goulding added RSA-SHA1 signature support to oauth1.0_token(). He also fixed bugs in oauth_service_token() and improved the caching behaviour of refresh_oauth2.0(). This makes httr easier to use with Google’s service accounts.
  • Graham Parsons added support for HTTP basic authentication to oauth2.0_token() with the use_basic_auth. This is now the default method used when retrieving a token.
  • Daniel Lockau implemented user_params which allows you to pass arbitrary additional parameters to the token access endpoint when acquiring or refreshing a token. This allows you to use httr with Microsoft Azure. He also wrote a demo so you can see exactly how this works.

To see the full list of changes, please read the release notes for 1.0.0 and 1.1.0.


To leave a comment for the author, please follow the link and comment on their blog: RStudio Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)