2

Hi I have a very strange problem when trying to make PUT request using easyXDM.

that.xhr.request({
                        url: url,
                        method: "PUT",
                        data: [{"foo":"test"}],
                        headers: { "Content-Type": "application/json;" }
                    }, function (response, xhr) {
                        options.success(jQuery.parseJSON(response.data));

                    },function(err) {
                        alert(err);
                    });

This does not generate request body message, instead it treats data as query string parameter. Is there anything that can be done regarding this? Thnx

emirkljucanin
  • 804
  • 1
  • 9
  • 20

1 Answers1

2

I just ran into the same problem and solved it the following way:

If you use the default index.html that is shipped with easyXDM on the remote site there is a line that says

var isPOST = (config.method == "POST");

Replace this line with

var isPOST = (config.method == "POST") || (config.method == "PUT");

and the data should be sent as form data instead of query string parameters.

suamikim
  • 5,350
  • 9
  • 40
  • 75
  • @suamikin there is so few people that have worked with easyXDM. May you look at http://stackoverflow.com/questions/27203172/easyxdm-download-files-from-3rd-party-service please? – VB_ Nov 29 '14 at 22:36