微信小程序GET 400 (Bad Request)解决方案

解决了接口的问题,接下来就是请求不正确,得不到数值 400 (Bad Request)

 可以用这个方法:wx.request传入的对象参数中的head改一下

wx.request({

 
  header: {
  // "Content-Type":"application/json"
  //这里修改json为text json的话请求会返回400(bad request)
  "Content-Type": "application/text"
  },
  URL:xxxxx;

})

就可以了。

200,成功!

猜你喜欢

转载自www.cnblogs.com/Timeouting-Study/p/12300414.html