From 5150e076cb2f08359f2f48e4ee0d1833f4a901cd Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 6 Jul 2018 22:31:37 -0600 Subject: [PATCH] bugfix: don't default to POST when json: true --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 936c9dd..80fc3c8 100644 --- a/index.js +++ b/index.js @@ -342,7 +342,7 @@ function setDefaults(defs) { } } - if (opts.body || opts.json || opts.form || opts.formData) { + if (opts.body || 'string' === typeof opts.json || opts.form || opts.formData) { reqOpts.method = (reqOpts.method || 'POST').toUpperCase(); } else { reqOpts.method = (reqOpts.method || 'GET').toUpperCase();