406 not acceptable (unable to receive exception) exception – springboot project login
Record a small but not small problem. When logging in to the springboot project, I want to return the data in the background to the front end in the form of an R object. The attributes in the R class are: troubleshooting: break point
,
point a little to troubleshoot
After many attempts: I found that the data can still be found out, so I first returned an object data without R class.
In fact, the data can still be transmitted to the front end, so I judged that it must be wrong when the R class data was transmitted. With the fastjson dependency, springboot will automatically convert the object into json and transmit it to the front end.
Reason for the error: It is because I added the annotation @Data less , resulting in no setter and getter methods being generated, and the object cannot be automatically converted into json data . As a result, when the backend transmits data to the frontend, such data cannot be received, and error 406 is unacceptable abnormal!