DEV environment Kendo AJAX Jquery call works -- UAT environment gives 405 Method Not Allowed

27 Views Asked by At

This code works perfectly in DEV environment. Now that it's in UAT, it's returning a 405 Method Not Allowed error. All I'm trying to do is a GET. For some reason, the response headers in the console are now showing "Allow: POST". I don't know why it's allowing POST, and I don't know how to change it. Here's the code below. The call failing is the first one being made to the GetThings stored procedure. Why is the response header allowing a POST when I'm trying to do a GET? How can I change the response header from POST to GET? Again, this works perfectly in DEV. Thanks

    var comboBox = $("#cappfMTF").kendoComboBox({
        dataTextField: "Name",
        dataValueField: "ID",
        template: '#:data.ID# - #:data.Name#',
        placeholder: "Select Thing",
        height: 260,
        autoBind: true,
        dataSource: {
            type: "json",
            serverFiltering: true,
            serverPaging: true,
            transport: {
                read: {
                    type: "GET",
                    url: "/_layouts/15/_Service/Service.svc/GetThings",
                    dataType: "json",
                    contentType: "application/json",
                    beforeSend: function (XMLHttpRequest) {
                        XMLHttpRequest.setRequestHeader("Accept", "application/json;odata=verbose");
                    }
                }
            },
            change: function () {
                var mtfValue = comboBox.value();
                $.ajax({
                    url: "/_layouts/15/_Service/_Services.svc/v_Things?$filter=IDName eq '" + mtfValue + "'",
                    dataType: "json",
                    beforeSend: function (XMLHttpRequest) {
                        XMLHttpRequest.setRequestHeader("Accept", "application/json;odata=verbose");
                    },
                    success: function (result) {
                        //set value of diff dropdown 
                        var diffCombo = $("#cappfMarket").data("kendoComboBox");
                        if (result.d.length == 1) {
                            var diffValue = result.d[0].diff;
                            diffCombo.value(diffValue);
                        }
                    }
                });
            },
            schema: {
                model: {
                    Id: "ID",
                    fields: {
                        ID: { type: "string" },
                        Name: { type: "string" }
                    }
                },
                data: function (response) {                  
                    return response.d;
                }
            }
        }
    }).data('kendoComboBox');```
0

There are 0 best solutions below