httr 1.1.0 (and 1.0.0)
This article is originally published at https://www.rstudio.com/blog/
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("httr")
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 oldmessage
argument with a newtask
argument that optionally describes the current task. This allows API wrappers to provide more informative error messages on failure.http_error()
replacesurl_ok()
andurl_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 inoauth_service_token()
and improved the caching behaviour ofrefresh_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 theuse_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.
Thanks for visiting r-craft.org
This article is originally published at https://www.rstudio.com/blog/
Please visit source website for post related comments.