balazsbotond / urlcat

A URL builder library for JavaScript.
https://urlcat.org
MIT License
1.82k stars 57 forks source link

Spaces in the query string are encoded as `%20` instead of `+` #1

Closed balazsbotond closed 4 years ago

balazsbotond commented 4 years ago

Input:

urlcat('http://example.com', '/path', { q: 'a b' })

Expected:

http://example.com/path?q=a+b

Actual:

http://example.com/path?a%20b
flxwu commented 3 years ago

Hey,

so actually in some use cases (like OAuth1) we require whitespaces to be encoded as %20, instead of +.

Can you thus please add an option to encode it as %20?

Thanks :)