Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Add PATCH http method for api request #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,16 @@ Connection.prototype.putUrl = function(data, callback) {
return this._apiRequest(opts, opts.callback);
};

Connection.prototype.patchUrl = function(data, callback) {
var opts = this._getOpts(data, callback, {
singleProp: 'url'
});
opts.uri = opts.oauth.instance_url + requireForwardSlash(opts.url);
opts.method = 'PATCH';
if (opts.body) opts.body = JSON.stringify(opts.body);
return this._apiRequest(opts, opts.callback);
};

Connection.prototype.postUrl = function (data, callback) {
var opts = this._getOpts(data, callback, {
singleProp: 'url'
Expand Down