How to get JSON instead of XML from Microsoft Translation API in R

169 Views Asked by At

I sent an API request to the Microsoft Translator API using R. I am getting back a XML file. How can I specify that I want a JSON file? Or does it make more sense to convert the XML file afterwards into a JSON file?

Here is my request:

Test <- httr::POST(url = path, body = Tweets_json, add_headers("Ocp-Apim-Subscription-Key"="XXXXX","Ocp-Apim-Subscription-Region"="XXXXX", "Content-type"="application/json"))
0

There are 0 best solutions below