dot-HttpRequest: Issue an HTTP request. This function allows multiple threads...

.HttpRequestR Documentation

Issue an HTTP request. This function allows multiple threads to issue requests concurrently, so the GC thread can issue DELETE requests while the main thread is in the middle of another request.

Description

Issue an HTTP request. This function allows multiple threads to issue requests concurrently, so the GC thread can issue DELETE requests while the main thread is in the middle of another request.

Usage

.HttpRequest(
  db_or_conn,
  method,
  uri,
  content_type = NULL,
  headers = list(),
  data = NULL,
  attachments = NULL
)

Arguments

db_or_conn

scidb database connection returned from scidbconnect, or its "connection" env attribute

method

a string specifying the HTTP method ("GET", "POST", "DELETE")

uri

the URI/URL to request

content_type

the MIME type of any data sent to the server (for POST)

headers

a named list of headers to include in the request

data

data to include in the request (for POST)

attachments

attachments to include in the request (for POST). This sets the Content-Type to "multipart/form-data" and each attachment is included in a separate multipart section. Each attachment is a named list where $data is the data being attached, and $content_type is the Content-Type to use for the attachment.

Value

If the server returns a response with a status code in the "success" range (200-299), returns the result of the call to curl::curl_fetch_memory. If not, stops execution with an error message.


Paradigm4/SciDBR documentation built on Nov. 9, 2023, 4:58 a.m.