Module: HTTPX::Plugins::FollowRedirects

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

Overview

This plugin adds support for automatically following redirect (status 30X) responses.

It has a default upper bound of followed redirects (see MAX_REDIRECTS and the max_redirects option), after which it will return the last redirect response. It will not raise an exception.

It doesn't follow insecure redirects (https -> http) by default (see follow_insecure_redirects).

It doesn't propagate authorization related headers to requests redirecting to different origins (see allow_auth_to_other_origins) to override.

It allows customization of when to redirect via the redirect_on callback option).

https://gitlab.com/os85/httpx/wikis/Follow-Redirects

Defined Under Namespace

Modules: ConnectionMethods, InstanceMethods, OptionsMethods, RequestMethods, _FollowRedirectsOptions

Constant Summary collapse

MAX_REDIRECTS =

Returns:

  • (Integer)
3
REDIRECT_STATUS =

Returns:

  • (Range[Integer])
(300..399).freeze
REQUEST_BODY_HEADERS =

Returns:

  • (Array[String])
%w[transfer-encoding content-encoding content-type content-length content-language content-md5 trailer].freeze

Class Method Summary collapse

Class Method Details

.extra_optionsOptions & _FollowRedirectsOptions

Parameters:

Returns:



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

def self.extra_options: (Options) -> (Options & _FollowRedirectsOptions)