Sha256: 34767835ccb97dcfa5657d1a4ee9cbf67005f1bb05e642f72ef9cc11239a6bd0

Contents?: true

Size: 576 Bytes

Versions: 15

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true
##
# Raised when a POST, PUT, or DELETE request results in a redirect
# see RFC 2616 10.3.2, 10.3.3 http://www.ietf.org/rfc/rfc2616.txt

class Mechanize::RedirectNotGetOrHeadError < Mechanize::Error
  attr_reader :page, :response_code, :verb, :uri
  def initialize(page, verb)
    @page           = page
    @verb           = verb
    @uri            = page.uri
    @response_code  = page.code
  end

  def to_s
    method = @verb.to_s.upcase
    "#{@response_code} redirect received after a #{method} request"
  end

  alias :inspect :to_s
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mechanize-2.12.2 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.12.1 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.12.0 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.11.0 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.10.1 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.10.0 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.9.2 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.9.1 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.9.0 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.8.5 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.8.4 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.8.3 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.8.2 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.8.1 lib/mechanize/redirect_not_get_or_head_error.rb
mechanize-2.8.0 lib/mechanize/redirect_not_get_or_head_error.rb