The aim of httr is to provide a wrapper for RCurl that is less configurable but customised to the demands of modern web APIs.
functions for the most important http verbs:
automatic connection sharing across requests to the same website (by default, curl handles are managed automatically), and cookies are maintained across requests.
a request object which captures the body of the request along with http status code, cookies, headers, timings and other useful information.
response content is available as a raw vector (
content), a character vector (
text_content), or parsed into an R object (
parsed_content, currently for html, xml, json, png and jpeg)
convert http errors into R errors with
wrapper functions for the most common configuration options:
url parsing (with
parse_url) and modification (with
support for OAuth 1.0 and 2.0. Use
oauth2.0_tokento get user tokens, and
sign_ouath2.0to sign requests. The demos directory has six demos of using OAuth: three for 1.0 (linkedin, twitter and vimeo) and three for 2.0 (facebook, github, google).
httr is still under active development, so is not yet available from CRAN. You can install the latest development version from github with: