The first is that I confirmed that response.setContentType("application/json;charset=utf-8") is set correctly
code show as below:
I couldn't find the clue, I looked at the front-end request header information:
It was determined that response.setContentType("application/json;charset=utf-8") did not take effect, and the code was correct. After reading the code carefully, I found a possible reason, as shown in the figure:
Then try:
Try it out:
an interesting pit