Alex Rivera | Logout

How do you URL encode parameters in Erlang?

Asked 2008-09-22T10:44:07.900
20

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?

Edit
Report

1 Answer

10

At least in R15 there is http_uri:encode/1 which does the job. I would also not recommend using edoc_lib:escape_uri as its translating an '=' to a %3d instead of a %3D which caused me some trouble.

answered 2012-04-27T14:26:15.037

Your Answer