I’m using httpc:request to post some data to a remote service. I have the post working but the data in the body() of the post comes through as is, without any URL-encoding which causes the post to fail when parsed by the remote service.
Is there a function in Erlang that is similar to CGI.escape in Ruby for this purpose?
You can find here the YAWS url_encode and url_decode routines
They are fairly straightforward, although comments indicate the encode is not 100% complete for all punctuation characters.