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.
168 169 170 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 168 def root_request @root_request end |
Instance Method Details
#max_redirects ⇒ Object
186 187 188 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 186 def max_redirects @options.max_redirects || MAX_REDIRECTS end |
#redirect_request ⇒ Object
170 171 172 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 170 def redirect_request @redirect_request || self end |
#redirect_request=(req) ⇒ Object
174 175 176 177 178 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 174 def redirect_request=(req) @redirect_request = req req.root_request = @root_request || self @response = nil end |
#response ⇒ Object
180 181 182 183 184 |
# File 'lib/httpx/plugins/follow_redirects.rb', line 180 def response return super unless @redirect_request @redirect_request.response end |