Sometimes HTTP 400 error is reported when Ajax requests background data – invalid request (Bad request); This request invalid error indicates that the request did not enter the background service;

The reason:

1. The field name or field type of the data submitted by the front-end is inconsistent with that of the entity class in the background, causing encapsulation failure; 2. The data submitted by the front-end to the background should be a JSON string type, but the front-end does not convert the object to a string type;

Solution:

1) Ensure consistency by referring to the field name and type

2) Use stringify to convert the object passed by the front end to a string data: json.stringify (param);

Original link: blog.csdn.net/qq_42363090…