Skip to content

Commit

Permalink
Added Patch method to JsonServiceClient.js and JsonServiceClient.clos…
Browse files Browse the repository at this point in the history
…ure.js
  • Loading branch information
DeonHeyns committed Sep 21, 2015
1 parent 7b5a2ec commit 5c9199f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/js/JsonServiceClient.closure.js
Expand Up @@ -111,6 +111,12 @@ JsonServiceClient.prototype.deleteFromService = function(webMethod, request, onS
this.send(webMethod, jsonRequest, onSuccess, onError, { type: "DELETE", processData: false, contentType: jsonContentType });
};

//Sends a HTTP 'PATCH' request as JSON @requires jQuery
JsonServiceClient.prototype.patchFromService = function(webMethod, request, onSuccess, onError) {
var jsonRequest = JsonServiceClient.toJSON(request);
this.send(webMethod, jsonRequest, onSuccess, onError, { type: "PATCH", processData: false, contentType: jsonContentType });
};

JsonServiceClient.id = 0;
JsonServiceClient.onError = function() { };
JsonServiceClient.onSuccess = function() { };
Expand Down
6 changes: 6 additions & 0 deletions lib/js/JsonServiceClient.js
Expand Up @@ -86,6 +86,12 @@ JsonServiceClient.prototype.deleteFromService = function(webMethod, request, onS
this.send(webMethod, jsonRequest, onSuccess, onError, { type: "DELETE", processData: false, contentType: "application/json; charset=utf-8" });
};

//Sends a HTTP 'PATCH' request as JSON @requires jQuery
JsonServiceClient.prototype.patchFromService = function(webMethod, request, onSuccess, onError) {
var jsonRequest = JsonServiceClient.toJSON(request);
this.send(webMethod, jsonRequest, onSuccess, onError, { type: "PATCH", processData: false, contentType: "application/json; charset=utf-8" });
};

JsonServiceClient.id = 0;
JsonServiceClient.onError = function() { };
JsonServiceClient.onSuccess = function() { };
Expand Down

0 comments on commit 5c9199f

Please sign in to comment.