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
192 193 194 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 192 def root_request @root_request end |
Instance Method Details
#max_redirects ⇒ Object
212 213 214 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 212 def max_redirects @options.max_redirects || MAX_REDIRECTS end |
#redirect_request ⇒ Object
returns the follow-up redirect request, or itself
195 196 197 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 195 def redirect_request @redirect_request || self end |
#redirect_request=(req) ⇒ Object
sets the follow-up redirect request
200 201 202 203 204 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 200 def redirect_request=(req) @redirect_request = req req.root_request = @root_request || self @response = nil end |
#response ⇒ Object
206 207 208 209 210 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 206 def response return super unless @redirect_request && @response.nil? @redirect_request.response end |