AnsweredAssumed Answered

Json reply from Rest API

Question asked by yannislionis on May 24, 2016
Latest reply on May 25, 2016 by sdetweil2

I have just finally figured out how to receive json output from the REST API and I'm bewildered.


The Accepts header that you're meant to pass seems to differ depending on which part of the REST API you're invoking. For example, the two commands below both work:


curl -H Accept:application/ -u USERNAME:PASSWORD "http://LISAHOST/api/Dcm/VSEs"

curl -H Accept:application/ -u USERNAME:PASSWORD "http://LISAHOST/api/Dcm/VSEs/VSE4/serviceName"


Highlighting the the bits in bold - the Accept header is different in each case. Funnily enough, that's what the root element in the response is called, vseList and VirtualService respectively (that's how I figured it out).


Why on earth is the server not just accepting "application/json"? Why is it different in each case?