fc_headers {rfieldclimate} | R Documentation |
Create authentication headers
Description
authentication is done via hmac, see fc_headers()
.
Usage
fc_headers(
method = c("GET", "PUT", "POST", "DELETE"),
path = NULL,
public_key = Sys.getenv("FC_PUBLIC_KEY"),
private_key = Sys.getenv("FC_PRIVATE_KEY")
)
fc_request(
method = c("GET", "PUT", "POST", "DELETE"),
path = NULL,
body = NULL,
public_key = Sys.getenv("FC_PUBLIC_KEY"),
private_key = Sys.getenv("FC_PRIVATE_KEY"),
verbose = FALSE,
timeout = 10
)
Arguments
method |
request method |
path |
request path (required) |
public_key |
public key.
Read by default from env variable |
private_key |
private key.
Read by default from env variable |
body |
request body named list. Will be passed to |
verbose |
logical, should the request be printed? |
timeout |
number of seconds to wait for a response before giving up. |
Value
an object of type "request" as returned by httr::add_headers()
.
a list with the parsed response.
See Also
https://api.fieldclimate.com/v2/docs/#authentication-hmac
Examples
fc_headers(path = "/user", public_key = "invalid", private_key = "invalid")
## Not run:
fc_request("GET", "/user")
## End(Not run)
[Package rfieldclimate version 0.1.1 Index]