Fork me on GitHub Fork me on GitHub


var data = {'key':'value'}; 
var headers = {'key', 'value'};
put(url, data, "text", headers, function (data, xhr) {
       log("Response received");


put() is a wrapper for XMLHTTPRequest's PUT method. using put() you can avoid the use of XHR and shorten the server-side PUT requests

put(url[, data][, type][, headers][, success(data, xhr)]) 
var res = put(url[, data][, type][, headers])


Parameter Type Description
urlStringThe URL which HTTP PUT is performed
dataObjectRequest parameters
typeStringThe type, which the response is expected
headersStringOptional HTTP headers
functionOn success callback

Return values

Value Type Description
dataObjectContains the return data of the HTTP PUT request
xhrObjectContains an instance of XMLHTTPRequest