Exception: Mechanize::RedirectNotGetOrHeadError
- Defined in:
- lib/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
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(page, verb) ⇒ RedirectNotGetOrHeadError
constructor
A new instance of RedirectNotGetOrHeadError.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(page, verb) ⇒ RedirectNotGetOrHeadError
Returns a new instance of RedirectNotGetOrHeadError.
6 7 8 9 10 11 |
# File 'lib/mechanize/redirect_not_get_or_head_error.rb', line 6 def initialize(page, verb) @page = page @verb = verb @uri = page.uri @response_code = page.code end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
5 6 7 |
# File 'lib/mechanize/redirect_not_get_or_head_error.rb', line 5 def page @page end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
5 6 7 |
# File 'lib/mechanize/redirect_not_get_or_head_error.rb', line 5 def response_code @response_code end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
5 6 7 |
# File 'lib/mechanize/redirect_not_get_or_head_error.rb', line 5 def uri @uri end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
5 6 7 |
# File 'lib/mechanize/redirect_not_get_or_head_error.rb', line 5 def verb @verb end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
13 14 15 16 |
# File 'lib/mechanize/redirect_not_get_or_head_error.rb', line 13 def to_s method = @verb.to_s.upcase "#{@response_code} redirect received after a #{method} request" end |