Wrap text
Report abuse
|
|
class TestController < ApplicationController
def index
@methods = %w{GET POST HEAD PUT DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK VERSION-CONTROL REPORT CHECKOUT CHECKIN UNCHECKOUT MKWORKSPACE UPDATE LABEL MERGE BASELINE-CONTROL MKACTIVITY ORDERPATCH ACL}
end
def echo
m = request.head? ? 'HEAD' : request.method.to_s.upcase
msg = m == params[:m].upcase ? 'OK' : "fail (got #{m})"
response.headers['X-Test-success'] = msg
expires_now
render :text => msg
end
end
|
views/test/index.rhtml (html)
|
|
Supported HTTP methods
<%= javascript_include_tag 'prototype' %>
Test what HTTP methods your browser supports
Tests are made by making an XMLHttpRequest for each of the methods and counting
the ones succeded.
[your user agent string]
|