Module: HTTPX::Plugins::FollowRedirects::InstanceMethods

Defined in:
lib/httpx/plugins/follow_redirects.rb,
sig/plugins/follow_redirects.rbs

Instance Method Summary collapse

Instance Method Details

#__get_location_from_response(response) ⇒ http_uri

:nodoc:

Parameters:

Returns:

  • (http_uri)


192
193
194
195
196
197
# File 'lib/httpx/plugins/follow_redirects.rb', line 192

def __get_location_from_response(response)
  # @type var location_uri: http_uri
  location_uri = URI(response.headers["location"])
  location_uri = response.uri.merge(location_uri) if location_uri.relative?
  location_uri
end

#handle_after_redirect_requestvoid

This method returns an undefined value.

Parameters:



27
# File 'sig/plugins/follow_redirects.rbs', line 27

def handle_after_redirect_request: (http_uri original_uri, http_uri redirect_uri, Request request, Options & _FollowRedirectsOptions options) -> void

#max_redirects(n) ⇒ instance

returns a session with the max_redirects option set to n

Parameters:

  • (_ToI)

Returns:

  • (instance)


65
66
67
# File 'lib/httpx/plugins/follow_redirects.rb', line 65

def max_redirects(n)
  with(max_redirects: n.to_i)
end