nuxt / http

Universal HTTP Module for Nuxt.js
https://http.nuxtjs.org
MIT License
229 stars 51 forks source link

fix: use json serialization for plain array #87

Closed MKGaru closed 4 years ago

MKGaru commented 4 years ago

Currently, sending array of object is not a json. It is sent as string in the body.(text/plain)

$http.$post('api', [data1, data2]) // invalid "[object Object],[object Object]" text-plain
$http.$post('api', void 0, { json: [data1, data2] }) // OK application/json

This pull request makes it possible.

Thak you.

pi0 commented 4 years ago

Thanks @MKGaru :)