Request method 'PUT' not supported?
发布于 7 年前 作者 otang 9601 次浏览 来自 问答

这个错误时有时无:

message : “Request method ‘PUT’ not supported” status: 405, error: “Method Not Allowed” 。

改成POST就报Request method ‘POST’ not supported。

controller处是@PutMapping(测试POST的时候改成Postmapping

部分代码如下:

wx.request({
        url: getApp().request_url + '/sign/SignUpdate',
        data: {
          signID: signID,
          status: status,
        },
        method: 'PUT',
        header: {
          'content-type': 'application/x-www-form-urlencoded',
          'login-token': user_SessionToken
        },
        success: function(res) {
          console.log("update res.data: ")
          console.log(res.data)
        }
})

请赐教,谢谢!

1 回复

这得看你接口是什么了 controller 自己看一下注解,是get post还是put。时有时无,如何复现

回到顶部