Module: HTTPX::Plugins::FollowRedirects::RequestMethods
- Defined in:
- lib/httpx/plugins/follow_redirects.rb
Instance Attribute Summary collapse
-
#root_request ⇒ Object
Returns the value of attribute root_request.
Instance Method Summary collapse
- #max_redirects ⇒ Object
- #redirect_request ⇒ Object
- #redirect_request=(req) ⇒ Object
- #response ⇒ Object
Instance Attribute Details
#root_request ⇒ Object
Returns the value of attribute root_request.
148 149 150 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 148 def root_request @root_request end |
Instance Method Details
#max_redirects ⇒ Object
166 167 168 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 166 def max_redirects @options.max_redirects || MAX_REDIRECTS end |
#redirect_request ⇒ Object
150 151 152 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 150 def redirect_request @redirect_request || self end |
#redirect_request=(req) ⇒ Object
154 155 156 157 158 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 154 def redirect_request=(req) @redirect_request = req req.root_request = @root_request || self @response = nil end |
#response ⇒ Object
160 161 162 163 164 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 160 def response return super unless @redirect_request @redirect_request.response end |