gc_request: Request a GWAS Catalog REST API endpoint

View source: R/request.R

gc_requestR Documentation

Request a GWAS Catalog REST API endpoint

Description

Performs a GET request on the specified resource_url.

Usage

gc_request(
  resource_url = "/",
  base_url = gwas_rest_api_base_url,
  verbose = FALSE,
  warnings = TRUE,
  flatten = FALSE
)

Arguments

resource_url

Endpoint URL. The endpoint is internally appended to the base_url. It should start with a forward slash (/).

base_url

The GWAS REST API base URL (one should not need to change its default value).

verbose

Whether to be chatty.

warnings

Whether to print warnings.

flatten

Whether to flatten out the list returned by jsonlite::fromJSON.

Value

A list four named elements:

url

The URL endpoint.

response_code

HTTP status code.

status

A string describing the status of the response obtained. It is "OK" if everything went OK or some other string describing the problem otherwise.

content

The parsed JSON as a nested list, as returned by jsonlite::fromJSON.


gwasrapidd documentation built on May 29, 2024, 4:31 a.m.