In these two days, a simple and small requirement was developed iteratively. The post request received the parameters from the front end and converted the received JSON format into the corresponding POJO. However, the program reported the following exceptions in the process of receiving the request:
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Invalid UTF-8 start byte 0xa0; nested exception is com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xa0 at [Source: [email protected]; line: 1, column: 61]
And because the front-end code has not been tested in the test environment, because it is tested using postman, 500 system abnormal error messages also appear in postman.
After a long time of searching on the Internet, I tried to set the content type attribute of the request response header, but it didn’t work and still reported an error;
After that, we also carefully checked whether there was a problem in the code, checked the @ requestbody annotation to receive JSON format data and convert it into the corresponding POJO, and the field properties are correct;
Finally, it is found in some blogs that it may also be the reason for Chinese spaces in JSON data, which is inspired.
After checking, use postman tool to select JSON strings with the same format, and the cursor will be displayed together. It is found that individual characters of Queshi do not correspond completely.
Check the corresponding sample
There is no exact correspondence
In fact, it can also be seen from the error message that it is a JSON parsing error, which roughly means that it is an invalid Chinese byte at the beginning.
- JSON parse e rror: Invalid UTF-8 middle byte 0x3f；
- java.lang.IllegalArgumentException : URI is not absolute error
- Four ways to get Django parameters in request
- JSON parse error: invalid UTF-8 solution series
- How to install postman tool in Ubuntu 16.04
- egg.js The frame post request reported an error of invalid CSRF token security verification, which has been solved
- Solution of error converting data type varchar to datetime in SQL Server
- Error reporting: error building sqlsession
- HTTP 400 error – bad request
- Ubuntu 18.04 installing postman
- Httprunner v3. X generates HTML report in assure format
- PHP big file upload problem (500m or above)
- Solution of Unicode decodeerror -‘utf-8 ‘codec can’t decode byte 0xc4 in position 0 – invalid continuation byte
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing
- Error: syntax error – unexpected token P in JSON at position 0
- Error: connect econnreused 127.0.0.1:7890 in postman
- Python’s json.loads Invalid control character
- Error: required request body is missing, @ requestbody annotation usage
- Error: cocoa error 3840
- To solve the problem of NPM run eject error in react