fix: use json serialization for plain array (#87)

master
MKGaru 2020-01-31 07:01:54 +09:00 committed by GitHub
parent e306573f39
commit febf2658dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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