1

I'm facing a problem with PUT request when using easyXDM. Other Operations such as POST, DELETE works fine. Initially it was placing data in query string. Tried following another post: easyXDM PUT places data in query string

After changing the code it is now sending the data in Request Payload but the data is not well formed, which is leading to the bad request.

putJson = function (url, request, success_callback, error_callback, custom_headers) {
        if (typeof (custom_headers) == "undefined") {
            custom_headers = {};
        };
        //custom_headers.Accept = "application/json";

        this.rpcSocket.request({
            url: url,
            method: "PUT",
            dataType: 'json',
            headers: { "Content-Type": "application/json"}, 
            data: request
        },
        function (response) {
            success_callback(response);
        },
        function (error_response) {
            if (_.isUndefined(error_callback) || !_.isFunction(error_callback)) {
                ajaxError.call(error_response);
            }
            else {
                error_callback(error_response)
            };
        });
    }
Community
  • 1
  • 1
Aditya
  • 173
  • 1
  • 3
  • 12

0 Answers0