Method: ActionDispatch::Request#method

Defined in:
lib/action_dispatch/http/request.rb

#method(*args) ⇒ Object

Returns the original value of the environment’s REQUEST_METHOD, even if it was overridden by middleware. See #request_method for more information.

For debugging purposes, when called with arguments this method will fall back to Object#method



217
218
219
220
221
222
223
224
225
226
# File 'lib/action_dispatch/http/request.rb', line 217

def method(*args)
  if args.empty?
    @method ||= check_method(
      get_header("rack.methodoverride.original_method") ||
      get_header("REQUEST_METHOD")
    )
  else
    super
  end
end