balazsbotond/urlcat

Add option to encode whitespace as %20

flxwu opened this issue · 6 comments

flxwu commented

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 :)

UP !

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

@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?

nvm, leveraging configure

LRNZ09 commented

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

This works for me in qs 3:

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

An easier option would be nice...