Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stringify array of objects #260

Closed
ktalebian opened this issue May 13, 2020 · 1 comment
Closed

Stringify array of objects #260

ktalebian opened this issue May 13, 2020 · 1 comment

Comments

@ktalebian
Copy link

How can I stringify an array of objects? Running

qs.stringify({foo: [{name: 'name1'}, {name: 'name2'}]}, {encode: false})

// Actual output
'foo=[object Object]&foo=[object Object]'

// Expected output
'foo={"name":"name1"}&foo={"name":"name2"}'
@sindresorhus
Copy link
Owner

This package doesn’t support nesting. I think https://github.com/ljharb/qs does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants