retrieve_one {ODataQuery}R Documentation

Retrieve single instance.

Description

Retrieve single instance.

Usage

retrieve_one(url, default = stop("value not found"), ...)

Arguments

url

Which url to fetch data from

default

The default if nothing was found. If not specified, an error is thrown in this case.

...

Arguments passed on to retrieve_data

metadata

Whether and how metadata is included

httr_args

List of additional arguments passed on to httr::GET

jsonlite_args

List of additional arguments passed on to jsonlite::fromJSON

Value

Single value or default if none. If the result consists of multiple records, an error is thrown.

See Also

Other retrieve: odata_function(), retrieve_all(), retrieve_data()

Examples

## Not run: 
url <- "https://services.odata.org/V4/TripPinServiceRW/People?$top=1"
retrieve_one(url)

url <- "https://services.odata.org/V4/TripPinServiceRW/People('russellwhyte')"
retrieve_one(url)

## End(Not run)

[Package ODataQuery version 0.5.3 Index]