get parameter from request

14 views
Skip to first unread message

serbita

unread,
May 2, 2008, 3:26:33 PM5/2/08
to MochiWeb
Hi guys,
We are changing the technology of our products, in this case java to
erlang. I am taking a look on mochiweb and I have a question.
I wanna get a parameter from a request but coudn't find a function to
get it (something like getParam(key)). I found a function called
parse_qs/1 in mochiweb_request module which gets a list of tuples
{key, value}. Once obtained this list I apply a function from lists
module and finally I can get the value.
I wonder if there is another way to get a param value using only
mochiweb. ???
Thanks a lot.

Bob Ippolito

unread,
May 2, 2008, 6:00:59 PM5/2/08
to moch...@googlegroups.com
parse_qs is the way to do it.

Params = Request:parse_qs(),
Foo = proplists:get_value("foo", Params).

It is not a goal of mochiweb to save you from using Erlang's standard
libraries...

Reply all
Reply to author
Forward
0 new messages