Closed hadley closed 1 month ago
One correction to the code (as the body could be also of raw type).
if (is.null(req$body)) {
body <- ""
} else if (request$body$type == "raw") {
body <- req$body$data
} else {
body <-
req$body$data %>%
jsonlite::toJSON(auto_unbox = TRUE)
}
@kalimu I ended up almost completely rewriting your code in #569 (just so I fully understand it and I'm equipped to maintain it in the future), but I can't tell you how much it helped to have a working implementation to start from. I've had to write code like this in the past and it's so frustrating because you have to have all the pieces perfectly aligned for it to work. Having something that already works that I can refactor saved me hours of frustration. Thank you!
If curl > 7.75.0, use https://curl.se/libcurl/c/CURLOPT_AWS_SIGV4.html. Otherwise fall back to something based on this code from @kalimu: