C# Axios.Delete()未执行,则catch块也未执行

C# Axios.Delete()未执行,则catch块也未执行,c#,reactjs,axios,C#,Reactjs,Axios,我有react+redux客户端和C#API。我目前正在尝试在react中实现delete方法 patients.js deletePatient(patientId) { debugger; axios.delete(url + 'patients/' + patientId).then(res => { this.props.dispatch(deletePatientAction(res)); }) .catch(

我有react+redux客户端和C#API。我目前正在尝试在react中实现delete方法

patients.js

deletePatient(patientId) {
    debugger;
    axios.delete(url + 'patients/' + patientId).then(res => 
    {      
        this.props.dispatch(deletePatientAction(res));
    })
    .catch( function(error) {
        console.log(JSON.stringify(error, null, 2));
    });
}
[HttpDelete]
    public HttpResponseMessage Delete(int id)
    {
        patientTasks.Delete(id);

        return Request.CreateResponse(HttpStatusCode.OK);
    }
PatientController.cs

deletePatient(patientId) {
    debugger;
    axios.delete(url + 'patients/' + patientId).then(res => 
    {      
        this.props.dispatch(deletePatientAction(res));
    })
    .catch( function(error) {
        console.log(JSON.stringify(error, null, 2));
    });
}
[HttpDelete]
    public HttpResponseMessage Delete(int id)
    {
        patientTasks.Delete(id);

        return Request.CreateResponse(HttpStatusCode.OK);
    }
当我在chrome中调试它时,我可以看到then和catch块并没有被执行。我的C#controller没有捕捉到该请求

当我与Postman尝试相同的请求时,请求通常在API中被捕获

即使我将url作为硬编码字符串,这也不起作用
axios.delete('http://localhost:1467/v1/patients/11)

你能告诉我发生了什么事吗


注意:get方法工作正常

非常感谢我的朋友,我正在发布工作解决方案。我缺少默认的标题。Postman是通过插入默认的标题,使用
axios
我必须自己定义它

deletePatient(patientId) {
        var config = {
            headers: {
                'User-Agent':'',
                'Accept':'',
                'Host':''
            }
        };

        axios.delete(url + 'patients/' + patientId, config).then((res) => 
        {      
            this.props.dispatch(deletePatientAction(res));
        })
        .catch( function(error) {
            console.log(JSON.stringify(error, null, 2));
        });            
}

如果你和邮递员运行相同的请求是否有效?是的,我在问题中告诉过它。对不起,我读得太快了。。。你在Chrome network inspector中看到了什么?当我通过axios Call时,网络中有任何新记录控制台是否显示任何错误?