bugfix: don't default to POST when json: true
This commit is contained in:
parent
f81dce9786
commit
5150e076cb
2
index.js
2
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();
|
reqOpts.method = (reqOpts.method || 'POST').toUpperCase();
|
||||||
} else {
|
} else {
|
||||||
reqOpts.method = (reqOpts.method || 'GET').toUpperCase();
|
reqOpts.method = (reqOpts.method || 'GET').toUpperCase();
|
||||||
|
|
Loading…
Reference in New Issue