From: Niklas Frykholm Date: 2001-09-19T01:27:00+09:00 Subject: [ruby-talk:21342] Re: Suggestions for new CGI lib On Wed, Sep 19, 2001 at 12:55:44AM +0900, Todd Gillespie wrote: > > imho it should be possible to select the values in the shown way. > > just for security and to be more flexible. > > > > ..:request.post["user_var"] or > > ..:request.get["user_var"] > > > > IMHO, this is dumb b/c a request can only be instantiated with either POST > or GET. > > Correct way would be: > > ..:request.form["user_var"] While it is true that the request method in HTTP is either POST or GET, most servers (at least Apache) will send you both "post" and "get" variables, in a situation like this:
I think that the interface should support both post/get (for users who want to know where the data came from) and #[] for users who do not care. Implementation would probably be something like: def [](key) post[key] + get[key] end // Niklas