Learn R Programming

datarobot (version 2.18.6)

MakeDataRobotRequest: Make a HTTP request

Description

Make a HTTP request

Usage

MakeDataRobotRequest(
  requestMethod,
  routeString,
  addUrl = TRUE,
  returnRawResponse = TRUE,
  as = "json",
  simplifyDataFrame = TRUE,
  body = NULL,
  query = NULL,
  timeout = DefaultHTTPTimeout,
  encode = NULL,
  followLocation = TRUE,
  filename = NULL,
  stopOnError = TRUE
)

Arguments

requestMethod

function. A function from httr (e.g., `httr::GET`, `httr::POST`) to use.

routeString

character. The path to make the request on.

addUrl

logical. Should the endpoint be prepended to the routeString? (Default TRUE).

returnRawResponse

logical. Whether to return the raw httr response object (as opposed to post processing and returning the content of that object, which is the default.)

as

character. What should the resulting data be interpreted as? (default "json"). Use "file" to download as a file (see filename).

simplifyDataFrame

logical. Whether to invoke jsonlite::simplifyDataFrame.

body

list. The body of the request for POST.

query

list. The query parameters for GET.

timeout

numeric. How many seconds before the request times out?

encode

character. What should the body be encoded as for the JSON request?

followLocation

logical. Should HTTR follow the location if provided? (Default TRUE).

filename

character. The path of the file to download to, if it is a download request.

stopOnError

logical. If there is an error, should it be raised as a fatal R error? (Default TRUE).