(x <- HttpRequest$new(url = "https://httpbin.org/get")$get())
x$url
x$payload
(x <- HttpRequest$new(url = "https://httpbin.org/post"))
x$post(body = list(foo = "bar"))
HttpRequest$new(
url = "https://httpbin.org/get",
headers = list(
`Content-Type` = "application/json"
)
)
Run the code above in your browser using DataLab