最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Getting 405 method not found for Put request

网站源码admin32浏览0评论

Getting 405 method not found for Put request

Getting 405 method not found for Put request

我正在处理更新一些数据的 put 调用,但 ut 抛出 405 方法未找到错误。但是当我尝试使用 post call 时,它工作正常。我也想将它与 put call 一起使用。

const opts = {
  headers: {
   'Content-Type': 'application/json',
   'Access-Control-Allow-Methods': '*',
   'Access-Control-Allow-Credentials': true,
   'Access-Control-Allow-Headers': 'X-Requested-With,content-type',
   httpsAgent: new Agent({
      rejectUnauthorized: false
        }), //CORS i tried to add 
   Accept: '*/*',
   Authorization: auth ,
   },
   method: 'PUT'  
}

return axios.put(endpoint, parameter, opts)
  .then((response) => {
    console.log(response);
   })
  .catch((err) => {
    console.log(err)
  });

Put call 应该有效。我尝试过邮寄电话,但那行得通。我尝试更改标题但没有运气。

回答如下:
发布评论

评论列表(0)

  1. 暂无评论