mirror of
https://git.coolaj86.com/coolaj86/request.js
synced 2025-04-20 06:10:38 +00:00
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…
x
Reference in New Issue
Block a user