Module: HTTPX::Plugins::FollowRedirects::RequestMethods
- Defined in:
- lib/httpx/plugins/follow_redirects.rb
Instance Attribute Summary collapse
-
#root_request ⇒ Object
returns the top-most original HTTPX::Request from the redirect chain.
Instance Method Summary collapse
- #max_redirects ⇒ Object
-
#redirect_request ⇒ Object
returns the follow-up redirect request, or itself.
-
#redirect_request=(req) ⇒ Object
sets the follow-up redirect request.
- #response ⇒ Object
Instance Attribute Details
#root_request ⇒ Object
returns the top-most original HTTPX::Request from the redirect chain
193 194 195 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 193 def root_request @root_request end |
Instance Method Details
#max_redirects ⇒ Object
213 214 215 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 213 def max_redirects @options.max_redirects || MAX_REDIRECTS end |
#redirect_request ⇒ Object
returns the follow-up redirect request, or itself
196 197 198 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 196 def redirect_request @redirect_request || self end |
#redirect_request=(req) ⇒ Object
sets the follow-up redirect request
201 202 203 204 205 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 201 def redirect_request=(req) @redirect_request = req req.root_request = @root_request || self @response = nil end |
#response ⇒ Object
207 208 209 210 211 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 207 def response return super unless @redirect_request && @response.nil? @redirect_request.response end |