2012-07-24 13 views
6

Sto usando cowboy (https://github.com/extend/cowboy) per un servizio web riposante, ho bisogno di ottenere i params da "http: // localhost: 8080/a = 1 & b = 2 & c = 32"Come ottenere i parametri http da Cowboy?

init({tcp, http}, Req, Opts) -> 
    log4erl:debug("~p~n", [Opts]), 
    {ok, Req, undefined_state}. 

handle(Req, State) -> 
    {ok, Req2} = cowboy_http_req:reply(200, [], <<"Hello World!">>, Req), 
    io:format("How to get the params from Req ? "), 
    {ok, Req2, State}. 

terminate(Req, State) -> 
    log4erl:debug("~p~p~n", [Req, State]), 
    ok. 

risposta