Erlang ChicagoBoss passing url get parameters -
i perform simple operation takes me hours solve in erlang , chicagoboss:
here 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>
check you're getting in requestbody
requestbody = string:tokens(binary_to_list(req:request_body()), "&")
Comments
Post a Comment