build_monarch_url: Builds URL for a monarch GET request.

Description Usage Arguments Details Value See Also Examples

View source: R/utils.R

Description

The path needs to be safely encoded.

Usage

1
build_monarch_url(path, query = NULL)

Arguments

path

A path as a list to the monarch resource to use.

query

A list of url parameter settings. TRUE FALSE set to "true" "false".

Details

But the query apparently will be re-encoded, even if it is already encoded. So it is best not to do any or our own encoding on the query list.

url <- httr::modify_url("https://api.monarchinitiative.org", path = "test query = list(x='this_is:ok', y="but_this_is "https://api.monarchinitiative.org/test

Value

URL as a safely encoded string.

See Also

URLencode

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
m_path <- "/api/bioentity/gene"
gene <- "NCBIGene%3A8314"
url <- build_monarch_url(path = list(m_path, gene),
                         query = list(rows = 100,
                         fetch_objects = "true",
                         format = "json"))
url <- build_monarch_url(path = list(m_path, gene),
                         query = list(rows = 100,
                         fetch_objects = TRUE,
                         unselect_evidence=FALSE,
                         format = "json"))
url <- build_monarch_url(path = list(m_path, gene),
                         query = list(rows = 100,
                         fetch_objects = TRUE,
                         unselect_evidence=NULL,
                         format = "json"))

charlieccarey/monarchr documentation built on May 11, 2018, 3:15 a.m.