小程序wx.request的POST方式传参

   wx.request({

     method: "POST",

     header: {

       "content-type": "application/x-www-form-urlencoded"

       "content-type": "application/json" // 默认

     },

   })

 使用默认的content-type,参数接收加上@RequestBody

@PostMapping("/insertAddress")
public RtnJson insertAddress(@RequestBody Address address) {

content-type 为form时,不使用@RequestBody

@PostMapping("/insertAddress")
public RtnJson insertAddress(Address address) {

 

你可能感兴趣的:(微信开发)