JSON response format error - red dot\bullet before response
I am sending an AJAX request expecting JSON response. However, the returned JSON is preceded with a red dot\bullet which is causing a parse error.
Here is a screenshot from Postman
:
The dot is not shown on Raw
or Preview
display, only on Pretty
.
In Chrome Dev Tools Network tab it appears under Response
. Preview
is shown normally as if the dot isn't there.
As mentioned in a comment before: In Chrome, red dots usually represent non-printable special unicode characters.
Please check your server side code to prevent outputting those characters
If your files are encoding with UTF-8, better to encode them with UTF-8 without BOM. This can be easily done through notepad++. The steps are as follows,
- Open your files in notepad++.
- Go to Encoding option on the file menu.
- Then select the option "convert to UTF-8 without BOM".
This may resolve your problem.
You need to clear you object buffer on server side.
I am using PHP as my server side language and I faced similar problem and the solution was cleaning my buffer using ob_clean();