Module: Roda::RodaPlugins::Head

Defined in:
lib/roda/plugins/head.rb

Overview

The head plugin attempts to automatically handle HEAD requests, by treating them as GET requests and returning an empty body without modifying the response status or response headers.

So for the following routes,

route do |r|
  r.root do
    'root'
  end

  r.get 'a' do
    'a'
  end

  r.is 'b', :method=>[:get, :post] do
    'b'
  end
end

HEAD requests for /, /a, and /b will all return 200 status with an empty body.

Defined Under Namespace

Modules: InstanceMethods, RequestMethods