As a follow on from: How translate this curl command into a R curl call?
I can successful do a curl request but the returned result looks to be in a binary format, but the content should be ASCII. How do I write it out as an ASCII file?
require(httr)
headers = c(
`Content-Type` = 'text/csv'
)
data = upload_file('data/data.csv')
res <- httr::POST(url = 'https://some.url.com/invocations', httr::add_headers(.headers=headers), body = data)