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

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"))


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source