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: can I use "encode: false" and "format: 'RFC1738'" options together #509

Open
dante-blitz opened this issue Jul 7, 2024 · 1 comment

Comments

@dante-blitz
Copy link

I am new to qs and am using it as part of react-instantsearch

I have the following code:

const queryString = qsModule.stringify(routeState, {
  encode: false,
  format: 'RFC1738',
})

which is giving me:

?music[0]=Hip%20Hop

Ideally I want the following

?music[0]=Hip+Hop

I've noticed that if I disable the "encoding: false" option I get:

?music%5B0%5D=Hip+Hop

Is there a way to combine both options to get the desired result...

?music[0]=Hip+Hop

Thanks in advance.

@ljharb
Copy link
Owner

ljharb commented Jul 8, 2024

try setting encodeValuesOnly to true

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

No branches or pull requests

2 participants