我正试图使用Ruby框架Ramaze来实现一个RESTful控制器。然而,当我发送Put时,似乎无法访问请求中的数据。样例代码:
require 'ramaze'
class PutController < Ramaze::Controller
map '/'
def index
"Argument of "+request[:id]
end
end
Ramaze.start
我通过旋度与之互动:
% curl -d id=5 "http://localhost:7000/"
Argument of 5
% curl -v -X PUT -d id=5 "http://localhost:7000/" > /dev/null
...
HTTP/1.1 500 Internal Server Error
[With a backtrace revealing that the request object is nil]
我做错什么了吗?我该如何处理《斋戒》中提出的请求?