httr: a friendly http package for R


License: Other

Language: R

Keywords: api, curl, http, r


Travis build status Codecov test coverage CRAN status

The aim of httr is to provide a wrapper for the curl package, customised to the demands of modern web APIs.

Key features:

  • Functions for the most important http verbs: GET(), HEAD(), PATCH(), PUT(), DELETE() and POST().

  • Automatic connection sharing across requests to the same website (by default, curl handles are managed automatically), cookies are maintained across requests, and a up-to-date root-level SSL certificate store is used.

  • Requests return a standard reponse object that captures the http status line, headers and body, along with other useful information.

    • Response content is available with content() as a raw vector (as = "raw"), a character vector (as = "text"), or parsed into an R object (as = "parsed"), currently for html, xml, json, png and jpeg.

    • You can convert http errors into R errors with stop_for_status().

  • Config functions make it easier to modify the request in common ways: set_cookies(), add_headers(), authenticate(), use_proxy(), verbose(), timeout(), content_type(), accept(), progress().

  • Support for OAuth 1.0 and 2.0 with oauth1.0_token() and oauth2.0_token(). The demo directory has eight OAuth demos: four for 1.0 (twitter, vimeo, withings and yahoo) and four for 2.0 (facebook, github, google, linkedin). OAuth credentials are automatically cached within a project.

httr wouldn't be possible without the hard work of the authors of curl and libcurl. Thanks! httr is inspired by http libraries in other languages, such as Resty, Requests and httparty.


To get the current released version from CRAN:


To get the current development version from github:

# install.packages("devtools")

Project Statistics

Sourcerank 18
Repository Size 3.72 MB
Stars 788
Forks 1,846
Watchers 60
Open issues 21
Dependencies 15
Contributors 64
Tags 16
Last updated
Last pushed

Top Contributors See all

Hadley Wickham Nathan Goulding Jennifer (Jenny) Bryan Jeroen Ooms Craig Citro Jean-Olivier Irisson Jim Hester DanielLockau-MLPA Artem Klevtsov grahamrp Carl Boettiger Martin Morgan Nicolas Coutin Christophe Dervieux Gábor Csárdi antoine-lizee Mara Averick Robert Krzyzanowski Charles Hans Thompson John Muschelli

Packages Referencing this Repo

Tools for Working with URLs and HTTP
Latest release 1.4.1 - Updated - 788 stars

Recent Tags See all

v1.4.1 July 30, 2019
v1.4.0 December 14, 2018
v1.3.1 August 18, 2017
v1.3.0 August 15, 2017
v1.2.1 July 03, 2016
v1.2.0 June 14, 2016
v1.1.0 January 27, 2016
v1.0.0 June 24, 2015
v0.6.1 December 31, 2014
v0.6 December 13, 2014
v0.5 September 02, 2014
v0.4 July 28, 2014
v0.3 March 19, 2014
httr-0.2 October 11, 2012
httr-0.1.1 June 20, 2012

Something wrong with this page? Make a suggestion

Last synced: 2019-08-05 14:43:55 UTC

Login to resync this repository