0

I am trying to pull some json body with passing an array of string numeric in httr::POST.This has to be an array. For instance, body = toJSON(x=list('_id'="1"), auto_unbox=TRUE) did not work.

How do I pass an array of string numeric like above in the body?

res <-httr::POST(url=some url, 
                 httr::add_headers(
                   "Accept"= "application/json",
                   "Authorization" = my Token, 
                   "Content-Type"= "application/json"),
                 body = ????, #how do i pass ["1"]
                 endoce = ???)
content(res,as = 'text')
Capt.Krusty
  • 579
  • 1
  • 4
  • 25

0 Answers0