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>
busy
  • 367
  • 1
  • 4
  • 14

1 Answers1

3

Check what you're getting in RequestBody

RequestBody = string:tokens(binary_to_list(Req:request_body()), "&")    
trex
  • 3,848
  • 4
  • 31
  • 54