Created
June 26, 2021 23:43
-
-
Save ThaddeusJiang/972216c0f1075f9e34fe904387b56b6b to your computer and use it in GitHub Desktop.
query string arrayFormat Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) | |
// 'a[0]=b&a[1]=c' | |
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) | |
// 'a[]=b&a[]=c' | |
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) | |
// 'a=b&a=c' | |
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) | |
// 'a=b,c' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment