标签:www ica serial rmi for type string url body
后台接收代码:
@PostMapping("/post/a") public String postA(User user){ System.out.println("/post/a"); System.out.println(user); return user.toString(); } @PostMapping("/post/b") public String postB(@RequestBody User user){ System.out.println("/post/b"); System.out.println(user); return user.toString(); }
对于 postA方法,则前端的提交方式为:
contentType:"application/x-www-form-urlencoded"
data:$("#formId").serializaArray() / 或者 data: $(‘#form1‘).serialize(),
----------------
对于 postB方法,则前端的提交方式为:
contentType:"application/json"
data:JSON.stringify(data)
标签:www ica serial rmi for type string url body
原文地址:https://www.cnblogs.com/dwb91/p/10074129.html