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

Support deeply nested arrays #274

Closed
Richienb opened this issue Sep 14, 2020 · 2 comments
Closed

Support deeply nested arrays #274

Richienb opened this issue Sep 14, 2020 · 2 comments

Comments

@Richienb
Copy link
Contributor

Richienb commented Sep 14, 2020

When using the Sendanywhere API, the following query parameters:

{
	files: [{
		name: 'a.txt',
		size: 1
	}, {
		name: 'b.txt',
		size: 2
	}]
}

should be encoded like so:

file[0][name]=a.txt&file[0][size]=1&file[1][name]=b.txt&file[1][size]=2

This sort of format is currently the default when using $.param().

It is almost achieved by arrayFormat: 'index' but it incorrectly serialized the objects as [object Object].

Helpful resources

// @sindresorhus

@sindresorhus
Copy link
Owner

I intentionally didn't want to open that can of worms (and potential security issues). For your needs, you'll have to use https://github.com/ljharb/qs

@sindresorhus
Copy link
Owner

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