This is the workhorse function for executing API requests for S3.
s3HTTP(verb = "GET", bucket = "", path = "", query = NULL,
headers = list(), request_body = "", accelerate = FALSE,
dualstack = FALSE, parse_response = TRUE, check_region = TRUE,
url_style = c("path", "virtual"), base_url = "s3.amazonaws.com",
verbose = getOption("verbose", FALSE),
region = Sys.getenv("AWS_DEFAULT_REGION", "us-east-1"),
key = Sys.getenv("AWS_ACCESS_KEY_ID"),
secret = Sys.getenv("AWS_SECRET_ACCESS_KEY"),
session_token = Sys.getenv("AWS_SESSION_TOKEN"), ...)
A character string containing an HTTP verb, defaulting to “GET”.
A character string with the name of the bucket, or an object of class “s3_bucket”. If the latter and a region can be inferred from the bucket object attributes, then that region is used instead of region
.
A character string with the name of the object to put in the bucket (sometimes called the object or 'key name' in the AWS documentation.)
Any query arguments, passed as a named list of key-value pairs.
A list of request headers for the REST call.
A character string containing request body data.
A logical indicating whether to use AWS transfer acceleration, which can produce significant speed improvements for cross-country transfers. Acceleration only works with buckets that do not have dots in bucket name.
A logical indicating whether to use “dual stack” requests, which can resolve to either IPv4 or IPv6. See http://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html.
A logical indicating whether to return the response as is, or parse and return as a list. Default is TRUE
.
A logical indicating whether to check the value of region
against the apparent bucket region. This is useful for avoiding (often confusing) out-of-region errors. Default is TRUE
.
A character string specifying either “path” (the default), or “virtual”-style S3 URLs.
A character string specifying the base URL for the request. There is no need to set this, as it is provided only to generalize the package to (potentially) support S3-compatible storage on non-AWS servers.
A logical indicating whether to be verbose. Default is given by options("verbose")
.
A character string containing the AWS region. Ignored if region can be inferred from bucket
. If missing, defaults to “us-east-1”.
A character string containing an AWS Access Key ID. If missing, defaults to value stored in environment variable “AWS_ACCESS_KEY_ID”.
A character string containing an AWS Secret Access Key. If missing, defaults to value stored in environment variable “AWS_SECRET_ACCESS_KEY”.
Optionally, a character string containing an AWS temporary Session Token. If missing, defaults to value stored in environment variable “AWS_SESSION_TOKEN”.
Additional arguments passed to an HTTP request function. such as GET
.
the S3 response, or the relevant error.
This is mostly an internal function for executing API requests. In almost all cases, users do not need to access this directly.