From 72b938b30a421739e7b08db0cf5fbc9304c93355 Mon Sep 17 00:00:00 2001 From: Spencer Carlson Date: Mon, 4 Dec 2023 14:22:59 -0700 Subject: [PATCH] Allow overriding of the HTTP method --- lib/client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index b875461..f04a495 100644 --- a/lib/client.js +++ b/lib/client.js @@ -18,6 +18,7 @@ var http = require('http') * - {String} url - (optional) - may be used instead of host/port pair * - {Boolean} cookies - (optional) - if true then cookies returned by server will be stored and sent back on the next calls. * Also it will be possible to access/manipulate cookies via #setCookie/#getCookie methods + * - {String} method - (optional) - HTTP method to use for request * @param {Boolean} isSecure - True if using https for making calls, * otherwise false. * @return {Client} @@ -68,7 +69,7 @@ function Client(options, isSecure) { } } - options.method = 'POST' + options.method = options.method || 'POST' this.options = options this.isSecure = isSecure