mirror of
https://github.com/therootcompany/request.js
synced 2025-02-22 05:48:05 +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();
|
||||
} else {
|
||||
reqOpts.method = (reqOpts.method || 'GET').toUpperCase();
|
||||
|
Loading…
x
Reference in New Issue
Block a user