鍍金池/ 問答/HTML/ ajax的patch方法請求報(bào)request:fail method is in

ajax的patch方法請求報(bào)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);
      }
    })

這個(gè)接口直接報(bào)
圖片描述

不知道是什么原因?

回答
編輯回答
我以為

設(shè)置一下 contentType

2017年1月25日 13:35