2

I would like to perform a simple operation that takes me hours to solve in erlang and ChicagoBoss:

Here is the url: http://example.com?string=some+string

Desired result:

some string

/controllers/index/example_index_controllers.erl

-module(example_index_controller, [Req, SessionID]).
-compile([export_all]).
index('GET', []) ->
Parameter = Req:query_param("string"),
{ok, [{data, Parameter  }]}.

result: /views/index/index.html

<b>{{ data }}</b>
4

1 回答 1

3

Check what you're getting in RequestBody

RequestBody = string:tokens(binary_to_list(Req:request_body()), "&")    
于 2015-05-05T07:44:09.760 回答