gojek/wrest

encoded plus sign ends up getting double encoded

Closed this issue · 2 comments

I'm attempting to use a plus sign as a query param in a POST. I need it interpreted as a plus not a space on the receiving end so I need to encode it. I encode it correctly so the plus sign is now a %2B. When I do the POST though it goes across the wire as double encoded looking like %252B which then gets decoded on that side as %2B and the POST fails since they were expecting it to be decoded to a plus sign instead.

There is a comment in uri.rb that says:

Remember to escape all parameter strings if necessary, using URI.escape

Which is being done so why the double encode?

Never mind this, found my issue. Someone else was encoding the params way further down before Wrest was getting it. Sorry about that

No worries. Please don't hesitate to drop me a note or open a ticket if there's something you need.