Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Standard Json Reply from an API Call

I am having argument with a friend here we are working on a project together. I am handling the front end and he is doing the backend API. I told him to return pure Json text in his reply to the API call. But instead, he replied with something like below:

callBackFunction({"sample": "value"});

I told him, it is supposed to be only

{"sample": "value"}

But he insisted that his way is the STANDARD JSON REPLY. We are still arguing about this till today.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

For now, I manually trim the extra texts just to get the Json, it works OK, but trimming texts and characters is so dangerous, prone to error etc. So, I want to ask all programmers in the world, is the callBackFunction() is part of the standard JSON reply???? It doesn’t make sense to me.

>Solution :

This has been answered here Is there any standard for JSON API response format?. But yes
{"sample": "value"} would be considered the standard way to receive JSON

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading