Convert curl code into R via the RCurl package?
问题 How I would write the following curl POST method using R and the RCurl package? curl -k -u myusername:mypassword -d '{"text":"Hello World!","level":"Noob"}' -H "Content-Type: application/json" -H "Accept: application/json" "http://api.website/v1/access?" 回答1: FINAL EDIT: After emailing the great Duncan Temple Lang I have a solution: library(RCurl) library(RJSONIO) postForm("http://api.website/v1/access?", .opts = list(postfields = toJSON(list(text = "Hello World!", level = "Noob")),