I have to post some JSON to a restful endpoint and decided to do this in R. I am aware of the httr library. However, I am not sure how to add an access token for Azure active directory. This is some code:
library(httr)
access_token <- "SomeSecretStuffeyJ0eXAiOiJKV"
json <- '{"test_data":"hello_world"}'
uri <- "https://somewhere.net/bla"
result <- POST(
uri
, content_type_json()
, body = json
)
I am not sure if I can do this using httr? Could someone please help out with code and/or suggest alternative library? Thanks!