405-AJAX响应中的方法不允许错误

时间:2019-06-25 07:53:05

标签: javascript ajax

我正在运行一个包含AJAX调用的示例代码,并记录其响应以405错误结尾。仔细检查了api调用中的所有数据。

       var settings = {
            "url": "https://avaya.instapract.com/web/api/default/login",
            "method": "POST",
            "timeout": 0,
            "headers": {
                "APPID": "APPMDUECCX",
                "lang": "da315627-3ece-2016-c628-b61dc5ee9be0",
                "Content-Type": "application/json"
            },
            "data": "{\n  \"username\": \"Doctor\",\n  \"password\": \"Test@123\",\n  \"device_id\": \"55c3389cb5ddd720dc0297617f3561c43a36218a277c974c8d43d545a643f45c\",\n  \"os_id\": \"82d10438-70e9-4b75-842c-13df79aeb720\",\n  \"time_zone\": \"America / New_York\",\n \"is_clinical_user\": \"no\",\n\"role_id\": \"143f37f2-ca38-0ab1-2489-1e47113655fc\"\n }",
        };

        $.ajax(settings).done(function (response) {
            console.log(response);
        });

0 个答案:

没有答案