Axios呼叫返回的我为null,但适用于邮递员

时间:2019-06-25 13:16:12

标签: javascript axios

我正在尝试对邮递员进行以下axios调用,但是无论出于何种原因,当我在axios上执行此操作时,它都会返回null。

我的axios电话:

myCall() {
  axios
    .post("/my/call", {

     value: 'info',
     value2: 'info',
     value3: 'info'
     }
       )
    .then(res => {
      console.log("my call", res)
    });
},

在邮递员中,我的原始身体中有以下内容。没有其他参数,唯一的标头是content-type是application / json,这是axios的默认值。

{         "value": "info",
         "value2": "info",
         "value3": "info"
}

编辑:

当我对值进行硬编码时,连接正常工作如下:

myCall() {
  axios
    .post("/my/call", {

     "value": "info",
     "value2": "info",
     "value3": "info"
     }
       )
    .then(res => {
      console.log("my call", res)
    });
},

0 个答案:

没有答案
相关问题