crul-package {crul}R Documentation

crul: HTTP Client

Description

logo

A simple HTTP client, with tools for making HTTP requests, and mocking HTTP requests. The package is built on R6, and takes inspiration from Ruby's 'faraday' gem (https://rubygems.org/gems/faraday). The package name is a play on curl, the widely used command line tool for HTTP, and this package is built on top of the R package 'curl', an interface to 'libcurl' (https://curl.se/libcurl/).

Package API

HTTP verbs (or HTTP request methods)

See verb-GET, verb-POST, verb-PUT, verb-PATCH, verb-DELETE, verb-HEAD for details.

Checking HTTP responses

HttpResponse() has helpers for checking and raising warnings/errors.

HTTP conditions

We use fauxpas if you have it installed for handling HTTP conditions but if it's not installed we use httpcode

Mocking

Mocking HTTP requests is supported via the webmockr package. See mock for guidance, and https://books.ropensci.org/http-testing/

Caching

Caching HTTP requests is supported via the vcr package. See https://books.ropensci.org/http-testing/

Links

Source code: https://github.com/ropensci/crul

Bug reports/feature requests: https://github.com/ropensci/crul/issues

Author(s)

Maintainer: Scott Chamberlain myrmecocystus@gmail.com (ORCID)

See Also

Useful links:


[Package crul version 1.4.2 Index]