balazsbotond / urlcat

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

Add option to encode whitespace as %20 #155

Closed flxwu closed 1 year ago

flxwu commented 3 years ago

Hey,

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?

Reference: https://stackoverflow.com/questions/9336267/url-encode-oauth-signature

Thanks :)

Kamsou commented 3 years ago

UP !

balazsbotond commented 1 year ago

I've just released v3.0.0 which uses qs - please check if the issue persists. If it does, I'll reopen this issue.

peterdyoon commented 1 year ago

@balazsbotond It seems like spaces are still converting to "+" as opposed to %20 as written in the docs. Is there an option to configure RFC formats?

peterdyoon commented 1 year ago

nvm, leveraging configure

LRNZ09 commented 11 months ago

@peterdyoon how did you configure urlcat to escape the + sign?

franck102 commented 6 months ago

This works for me in qs 3:

query(params, { objectFormat: { format: "RFC3986" } })

An easier option would be nice...