【Java】Springboot ajax发送JSON类型的POST参数

springMVC controller的@RequestBody作对象映射
使用JSON库将 & 格式解析为 {} JSON格式即可:如下 var jsonData = {"userName": userName, "userPassword": userPassword};
data: JSON.stringify(jsonData), 此时后台可以使用@RequestBody自动映射json参数到对象属性

  

原文地址:https://www.cnblogs.com/defineconst/p/13830773.html