Method: HTTParty::ClassMethods#no_follow

Defined in:
lib/httparty.rb

#no_follow(value = false) ⇒ Object

Declare whether or not to follow redirects. When true, an RedirectionTooDeep error will raise upon encountering a redirect. You can then gain access to the response object via HTTParty::RedirectionTooDeep#response.

Examples:

class Foo
  include HTTParty
  base_uri 'http://google.com'
  no_follow true
end

begin
  Foo.get('/')
rescue HTTParty::RedirectionTooDeep => e
  puts e.response.body
end

See Also:



256
257
258
# File 'lib/httparty.rb', line 256

def no_follow(value = false)
  default_options[:no_follow] = value
end