Home > Back-end >  For springmvc by @ requestBody javaBean receiving injection cross-domain request, but an error 415
For springmvc by @ requestBody javaBean receiving injection cross-domain request, but an error 415

Time:10-30

[b] presents at the front desk to send cross-domain post request json parameters to the backend Java, for springmvc by @ requestBody javaBean receiving injection, but an error 415,
By viewing the request after, found that just send the options request, without sending a post request, cross-domain itself will be a problem, because there is no javaBean receiving injection is not an error, but don't want to give up this function, seeks the solution

CodePudding user response:

CORS impression, can try the json or configuration

CodePudding user response:

Cross-domain request json support only a GET

CodePudding user response:

To javabeans
Above 2 said the cross domain, the building Lord also said no problem
Should be @ requestBody
Backend use this annotation, the front-end of ajax to do two special processing, one is the content-type=application/json, another is the data to do with js json processing json. The stringify (data)
  • Related