0

I am working on a project with IBM Natural Language Understanding.

When I POST to this endpoint, the service provides its output in JSON.

Since other Watson projects (Watson Explorer family) used to rely on XML technology, I was wondering whether it is possible to get the NLU output into a XML format.

I have tried to add the HTTP Accept Header: application/xml. But that returns

 "error": "response not acceptable",
 "code": 406
data_henrik
  • 16,724
  • 2
  • 28
  • 49
Joost Vos
  • 31
  • 4
  • Thanks @data_henrik for the edit. In the meantime, I solved the issue by converting the JSON output to XML in Python3 using the solution posted here: [link](https://stackoverflow.com/questions/8988775/convert-json-to-xml-in-python#8996104) by diemacht, answered Oct 20 '13 at 6:30. Still, I remain interested to learn whether the [IBM NLU endpoint](https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2020-08-01) – Joost Vos Nov 09 '20 at 20:37

1 Answers1

0

JSON is the typical output format for all recent Internet / Cloud services. It is more compact than XML and has a broad set of tooling and SDK support. Thus, the API for IBM Watson Natural Language Understanding only returns JSON-formatted responses.

data_henrik
  • 16,724
  • 2
  • 28
  • 49