Skip to contents

Execute an API query

Usage

ppQuery(op, baseurl, args = NULL, verbose = FALSE, ...)

Arguments

op

A character string containing an API operation, and associated arguments.

baseurl

The base URL for conducting the API query.

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

...

Arguments passed on to httr::GET

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

Value

The result of the query, typically a list object.

Author

Thomas J. Leeper

Examples

if (FALSE) {
geos <- ppQuery("geos",
  baseurl = "http://projects.propublica.org/forensics/"
)
}