ajax的patch方法请求报request:fail method is invalid?

wx.request({
      url: dataUrl,
      method: 'PATCH',
      data: { "isRead": true },
      header: app.globalData.headerCommon,
      success: function (res) {
        if (res.data.code === 200) {
          typeof callback == 'function' && callback(res.data.data, setKey);
        }
        else {
          showError(res.data.msg);
        }
      },
      fail: function (error) {
        console.log(error);
      }
    })

这个接口直接报
图片描述

不知道是什么原因?

阅读 5.1k
1 个回答

设置一下 contentType

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题