According to the OpenNMS Wiki (http://www.opennms.org/wiki/ReST), in order to get results in JSON format you have to send a "Accept: application/json" header.
By default a request to the API is returned in XML. To get JSON encoded responses one has to send the following header with the request: "Accept: application/json".
Instead I would like to see this done by using an URL parameter. As well as support for JSONP (JSON with Padding) >> http://en.wikipedia.org/wiki/JSONP
The response header from the API should also be 'Content-type: application/json' for example.
This would allow me to be able to dynamically write a script tag in a Javascript application which would return the payload to the callback handler when the script loads (REST API returns JSON data)
Therefore I would not need to use a server side script as a broker to make these API calls in my web applications.
According to the OpenNMS Wiki (http://www.opennms.org/wiki/ReST), in order to get results in JSON format you have to send a "Accept: application/json" header.
By default a request to the API is returned in XML. To get JSON encoded responses one has to send the following header with the request: "Accept: application/json".
Instead I would like to see this done by using an URL parameter. As well as support for JSONP (JSON with Padding) >> http://en.wikipedia.org/wiki/JSONP
Example: /restAPIEndpoint?fmt=json&callback=parseJSON
This call would return data as follows
parseJSON({JSON_RESPONSE});
The response header from the API should also be 'Content-type: application/json' for example.
This would allow me to be able to dynamically write a script tag in a Javascript application which would return the payload to the callback handler when the script loads (REST API returns JSON data)
Therefore I would not need to use a server side script as a broker to make these API calls in my web applications.
https://mynms.opennms.com/Ticket/Display.html?id=3017