RestUri-class {restfulr}R Documentation

RestUri

Description

The RestUri object represents a resource accessible via a RESTful interface. It extends character with a protocol, used for accessing the data, as well as a cache. R objects are converted to/from external media via the Media framework.

CRUD interface

There are four canonical, abstract types of REST operations: create, read, update, delete (CRUD). The CRUD model was borrowed from traditional databases. The restfulr package maps those four operations to R functions of the same name. The functions are generic, and there are methods for RestUri and character (taken to be a URI), described below.

Constructor

Container support

Authentication

RestUri currently supports basic HTTP authentication. Call authenticate(x) to add credentials to the RestUri x. Retrieve the Credentials object with the credentials accessor.

Once a set of credentials has been entered, it is recorded for the URI in ‘$(HOME)/.local/config/restfulr/credentials.yaml’. The path prefix can be changed via the XDG_CONFIG_DIR environment variable, according to the XDG standard. The credential cache is checked during authentication, so that a user does not need to reenter credentials for the same URI.

If the getPass package is installed, we use it for password entry. Otherwise, we rely on an implementation that shows the password as it is entered, unless the user is in a terminal, where we can hide input.

Utilities

Author(s)

Michael Lawrence

Examples

apache <- RestUri("http://wiki.apache.org")
read(apache$solr)

[Package restfulr version 0.0.15 Index]