mirror of https://github.com/sundowndev/http.git
fix: use json serialization for plain array (#87)
parent
e306573f39
commit
febf2658dc
|
@ -58,7 +58,7 @@ for (let method of ['get', 'head', 'delete', 'post', 'put', 'patch']) {
|
|||
} else {
|
||||
options = arg2 || {}
|
||||
if (arg1 !== undefined) {
|
||||
if (arg1.constructor === Object) {
|
||||
if (arg1.constructor === Object || Array.isArray(arg1)) {
|
||||
options.json = arg1
|
||||
} else {
|
||||
options.body = arg1
|
||||
|
|
Loading…
Reference in New Issue