Exception: WWW::Mechanize::RedirectNotGetOrHeadError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/www/mechanize/redirect_not_get_or_head_error.rb

Overview

Thrown when a POST, PUT, or DELETE request results in a redirect see RFC 2616 10.3.2, 10.3.3 www.ietf.org/rfc/rfc2616.txt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page, verb) ⇒ RedirectNotGetOrHeadError

Returns a new instance of RedirectNotGetOrHeadError.



7
8
9
10
11
12
# File 'lib/www/mechanize/redirect_not_get_or_head_error.rb', line 7

def initialize(page, verb)
  @page           = page
  @verb           = verb
  @uri            = page.uri
  @response_code  = page.code
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



6
7
8
# File 'lib/www/mechanize/redirect_not_get_or_head_error.rb', line 6

def page
  @page
end

#response_codeObject (readonly)

Returns the value of attribute response_code.



6
7
8
# File 'lib/www/mechanize/redirect_not_get_or_head_error.rb', line 6

def response_code
  @response_code
end

#uriObject (readonly)

Returns the value of attribute uri.



6
7
8
# File 'lib/www/mechanize/redirect_not_get_or_head_error.rb', line 6

def uri
  @uri
end

#verbObject (readonly)

Returns the value of attribute verb.



6
7
8
# File 'lib/www/mechanize/redirect_not_get_or_head_error.rb', line 6

def verb
  @verb
end

Instance Method Details

#to_sObject Also known as: inspect



14
15
16
# File 'lib/www/mechanize/redirect_not_get_or_head_error.rb', line 14

def to_s
  "#{@response_code} redirect received after a #{@verb} request"
end