ndex_rest_POST: Generic POST query to API

Description Usage Arguments Details Value Note See Also Examples

View source: R/ndex_connect.r

Description

Generic POST query to API

Usage

1
ndex_rest_POST(ndexcon, route, data, multipart = FALSE, raw = FALSE)

Arguments

ndexcon

object of class NDExConnection ndex_connect

route

Character (route to specific REST query)

data

Whatever data to be supplied with query. Should be valid JSON

multipart

Whatever data to be supplied with query. Should be valid JSON

raw

Specifies if server response should be returned in raw, or if jsonlite::fromJSON is called first. Defaults to FALSE.

Details

Simply execute HTTP POST on URL host/route and fetch whatever data REST server returns Making sure the route is well-formed is the job of calling function Making sure the data is well-formed is also the job of calling function

Value

JSON response from REST server, NULL if no valid JSON was received. if parameter raw is TRUE, the raw response is returned without a call to jsonlite::fromJSON.

Note

This function is internal.

See Also

ndex_rest_GET, ndex_rest_POST, ndex_rest_PUT and ndex_rest_DELETE

Examples

1
2
3
4
5
6
7
8
## Establish a server connection
ndexcon = ndex_connect()
## Not run: 
ndex_rest_POST(ndexcon, "/networks/api", data)
ndex_rest_POST(ndexcon, "/networks/api", data, raw=TRUE)
ndex_rest_POST(ndexcon, "/networks/api", list(some=data, other=data2), multipart=TRUE)

## End(Not run)

ndexr documentation built on March 13, 2021, 2 a.m.