I wrote a script which makes a GET request. Like this:
curl -H "content-type: application/xml" -s -o "/private/tmp/computers.xml" -fku "username":"password" "https://jamf.example.com/JSSResource/computers" -X GET
If the inventory contains 0 computers I get a JSON response. If there are more than 0 computers the output is XML, which is correct. This happens only on Jamf Pro 10.3.
Is this a product issue or is my curl command wrong? I even tried to force a XML response by defining the header.
Solved! Go to Solution.
I remember a few versions ago (I think 9.96 or 9.98) the default for many things changed from xml to json and I had to update my scripts to explicitly request xml. And yet now, on 9.101, I just ran some tests and can't find anything that defaults to json. Hmm. Maybe it was just a bug.
In any case, it seems prudent to explicitly request the data type as a matter of habit.