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