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
I encountered the lack of this feature in the HTTP modules as well.
It turns out that this functionality is actually available in the erlang distribution, you just gotta look hard enough.
> edoc_lib:escape_uri("luca+more@here.com").
"luca%2bmore%40here.com"
This behaves like CGI.escape in Ruby, there is also URI.escape which behaves slightly differently:
> CGI.escape("luca+more@here.com")
=> "luca%2Bmore%40here.com"
> URI.escape("luca+more@here.com")
=> "luca+more@here.com"
edoc_lib