Fork me on GitHub Fork me on GitHub

put()


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

Overview

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])


Parameters

Parameter Type Description
urlStringThe URL which HTTP PUT is performed
dataObjectRequest parameters
typeStringThe type, which the response is expected
headersStringOptional HTTP headers
success(data:Object,
xhr:Object)
functionOn success callback

Return values

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