RequestSignature | R Documentation |
General purpose request signature builder
method
(character) an http method
uri
(character) a uri
body
(various) request body
headers
(list) named list of headers
proxies
(list) proxies as a named list
auth
(list) authentication details, as a named list
url
internal use
disk
(character) if writing to disk, the path
fields
(various) request body details
output
(various) request output details, disk, memory, etc
new()
Create a new RequestSignature
object
RequestSignature$new(method, uri, options = list())
method
the HTTP method (any, head, options, get, post, put, patch, trace, or delete). "any" matches any HTTP method. required.
uri
(character) request URI. required.
options
(list) options. optional. See Details.
A new RequestSignature
object
print()
print method for the RequestSignature
class
RequestSignature$print()
x
self
...
ignored
to_s()
Request signature to a string
RequestSignature$to_s()
a character string representation of the request signature
clone()
The objects of this class are cloneable with this method.
RequestSignature$clone(deep = FALSE)
deep
Whether to make a deep clone.
# make request signature
x <- RequestSignature$new(method = "get", uri = "https:/httpbin.org/get")
# method
x$method
# uri
x$uri
# request signature to string
x$to_s()
# headers
w <- RequestSignature$new(
method = "get",
uri = "https:/httpbin.org/get",
options = list(headers = list(`User-Agent` = "foobar", stuff = "things"))
)
w
w$headers
w$to_s()
# headers and body
bb <- RequestSignature$new(
method = "get",
uri = "https:/httpbin.org/get",
options = list(
headers = list(`User-Agent` = "foobar", stuff = "things"),
body = list(a = "tables")
)
)
bb
bb$headers
bb$body
bb$to_s()
# with disk path
f <- tempfile()
bb <- RequestSignature$new(
method = "get",
uri = "https:/httpbin.org/get",
options = list(disk = f)
)
bb
bb$disk
bb$to_s()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.