From 5ac4ce4df57865ff68bdcfb66ce8589a083976c3 Mon Sep 17 00:00:00 2001 From: batesbw Date: Fri, 31 Dec 2021 21:31:03 +1000 Subject: [PATCH] Add PATCH http method for api request --- index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/index.js b/index.js index b48b551..74dc240 100644 --- a/index.js +++ b/index.js @@ -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'