retrieve_one: Retrieve single instance.

Description Usage Arguments Value See Also Examples

View source: R/retrieve.R

Description

Retrieve single instance.

Usage

1
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

1
2
3
4
5
6
7
8
## 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)

ODataQuery documentation built on July 5, 2021, 5:09 p.m.