Has anyone used calais tagging in R?

h = c("X-AG-Access-Token" = key , "Content-Type" = "text/raw" , "outputformat" = "application/json; charset=utf-8") b<-list(body=upload_file("test.txt"))

POST(url=api ,add_headers(.headers=h) ,accept_json() ,encode = "multipart" ,body=text ,verbose())

I've been working with this code for a few days and would greatly appreciate any help!

Best Answer

  • Tag API doesn't support "multipart". I would start with something like this:

    POST(url="<<url>>", add_headers(.headers=c("Content-Type"="text/raw", "X-AG-Access-Token"="<<key>>")), accept_json(), verbose(), body="<<some-text-to-tag>>")