From: Yohanes Santoso Date: 2005-10-20T04:38:41+09:00 Subject: Re: WEBrick & forms using post James McCarthy writes: > Im trying to write a webrick servlet to process a html form. > Im using the post method to send, NOT get (in the html form). > I have require 'cgi' in my servlet. > But I keep getting: > > Method not allowed > unsupported method 'post' > > Any ways to get around this or am I doing something wrong? > > > -- > My Blog: http://27degrees.blogspot.com A WEBrick servlet is not a CGI, so, doing require 'cgi' is just a gratuitous exercise, unless you want to use some of cgi's convenience methods like CGI::escape, unescape, parse, etc. A servlet accepts method POST if it has a method do_POST(request, response): E.g.: class FooServlet < HTTPServlet::AbstractServlet def do_POST(req, resp) resp['content-type'] = 'text/plain' resp.body << "You posted the following content:\n" resp.body << req.body end end YS.