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
202 203 204 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 202 def root_request @root_request end |
Instance Method Details
#max_redirects ⇒ Object
222 223 224 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 222 def max_redirects .max_redirects || MAX_REDIRECTS end |
#redirect_request ⇒ Object
returns the follow-up redirect request, or itself
205 206 207 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 205 def redirect_request @redirect_request || self end |
#redirect_request=(req) ⇒ Object
sets the follow-up redirect request
210 211 212 213 214 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 210 def redirect_request=(req) @redirect_request = req req.root_request = @root_request || self @response = nil end |
#response ⇒ Object
216 217 218 219 220 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 216 def response return super unless @redirect_request && @response.nil? @redirect_request.response end |