Novice Question:
I have a rest api in my application : https://hostname/app-rest/session/manager/active-session/count. The API returns the number of sessions with certain attributes like connection type, status, etc.
When I set the request header Content-Type: application/json, response header Accept: application/json and send a request with body like:
{"loggedIn": "yes", connectionType" : "mobile"}, I get a response with a number 0, 1, 2 etc.
QUESTION: Based on this: http://json.org/, it seems that the response is a valid JSON format. However, is this good design practice? Isn't it preferable to return the value in a key value pair format so that all clients can understand and parse the response - instead of assuming that the client has the knowledge of what is returned by the API ?