0

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.

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.

2
  • 2
    callBackFunction({"sample": "value"}); is clearly not valid JSON. Commented Aug 15, 2022 at 4:12
  • Thanks @CameronSkinner that's what I thought. Commented Aug 15, 2022 at 4:18

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.