Learn R Programming

aws.s3 (version 0.1.34)

s3HTTP: S3 HTTP Requests

Description

This is the workhorse function for executing API requests for S3.

Usage

s3HTTP(verb = "GET", bucket = "", path = "", query = NULL, headers = list(), request_body = "", accelerate = 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"), parse_response = TRUE, ...)

Arguments

verb
A character string containing an HTTP verb, defaulting to “GET”.
bucket
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.
path
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.)
query
any queries, passed as a named list
headers
a list of request headers for the REST call.
request_body
character string of request body data.
accelerate
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.
region
A character string containing the AWS region. Ignored if region can be inferred from bucket. If missing, defaults to “us-east-1”.
key
A character string containing an AWS Access Key ID. If missing, defaults to value stored in environment variable “AWS_ACCESS_KEY_ID”.
secret
A character string containing an AWS Secret Access Key. If missing, defaults to value stored in environment variable “AWS_SECRET_ACCESS_KEY”.
session_token
Optionally, a character string containing an AWS temporary Session Token. If missing, defaults to value stored in environment variable “AWS_SESSION_TOKEN”.
parse_response
return the response as is, or parse and return as a list? Default is TRUE.
...
Additional arguments passed to an HTTP request function. such as GET.

Value

the S3 response, or the relevant error.

Details

This is mostly an internal function for executing API requests. In almost all cases, users do not need to access this directly.