https://www.rfc-editor.org/rfc/rfc8941#name-byte-sequences
parse_sf_binary <- function(x) {
# Trim metadata before and after the main Base64-encoded string
x <- sub("^.*?:", "", x) # Remove anything before and including the first ":"
x <- sub(":.*$", "", x) # Remove anything after and including the last ":"
# Decode the remaining Base64-encoded string
openssl::base64_decode(x)
}
It looks like all of the "sf-" formats can also have metadata after ";" at the end, so strip that out, too. We'll need to do this for all of these "sf" ("structured field") formats. Does httr2 already deal with these?
https://www.rfc-editor.org/rfc/rfc8941#name-byte-sequences
It looks like all of the "sf-" formats can also have metadata after ";" at the end, so strip that out, too. We'll need to do this for all of these "sf" ("structured field") formats. Does httr2 already deal with these?