Skip to content

jeroen/curl

Repository files navigation

curl

A Modern and Flexible Web Client for R

CRAN_Status_Badge CRAN RStudio mirror downloads

Bindings to libcurl for performing fully customizable HTTP/FTP/SCP requests where responses can be processed either in memory, on disk, or streaming via the callback or connection interfaces. Some knowledge of 'libcurl' is recommended; for a more-user-friendly web client see the 'httr2' package which builds on this package with http specific tools and logic

Installation

The latest version of the package can be installed from r-universe:

install.packages("curl", repos = "https://jeroen.r-universe.dev")

Other resources to get started:

Install from source on Linux / MacOS

Installation from source on Linux requires libcurl. On Debian or Ubuntu use libcurl4-openssl-dev:

sudo apt-get install -y libcurl-dev

On Fedora, CentOS or RHEL use libcurl-devel:

sudo yum install libcurl-devel

On MacOS libcurl is included with the system, so usually nothing extra is needed. However if you want to test using the very most recent version of libcurl you can install curl from homebrew and then recompile the R package:

brew install curl pkg-config

You need to set the PKG_CONFIG_PATH environment variable to help R find the non-default curl, when building from source. Run this in a clean R session which does not have the curl package loaded already:

Sys.setenv(PKG_CONFIG_PATH="/opt/homebrew/opt/curl/lib/pkgconfig:/usr/local/opt/curl/lib/pkgconfig")
install.packages("curl", type = "source")