Module: CMSScanner::Browser::Actions
- Included in:
- CMSScanner::Browser
- Defined in:
- lib/cms_scanner/browser/actions.rb
Overview
Browser Actions (get, post etc)
Instance Method Summary collapse
- #forge_request(url, params = {}) ⇒ Typhoeus::Request
- #get(url, params = {}) ⇒ Typhoeus::Response
- #get_and_follow_location(url, params = {}) ⇒ Typhoeus::Response
- #head(url, params = {}) ⇒ Typhoeus::Response
- #post(url, params = {}) ⇒ Typhoeus::Response
Instance Method Details
#forge_request(url, params = {}) ⇒ Typhoeus::Request
11 12 13 |
# File 'lib/cms_scanner/browser/actions.rb', line 11 def forge_request(url, params = {}) NS::Browser.instance.forge_request(url, params) end |
#get(url, params = {}) ⇒ Typhoeus::Response
19 20 21 |
# File 'lib/cms_scanner/browser/actions.rb', line 19 def get(url, params = {}) forge_request(url, params.merge(method: :get)).run end |
#get_and_follow_location(url, params = {}) ⇒ Typhoeus::Response
43 44 45 |
# File 'lib/cms_scanner/browser/actions.rb', line 43 def get_and_follow_location(url, params = {}) get(url, { followlocation: true, maxredirs: 3 }.merge(params)) end |
#head(url, params = {}) ⇒ Typhoeus::Response
35 36 37 |
# File 'lib/cms_scanner/browser/actions.rb', line 35 def head(url, params = {}) forge_request(url, params.merge(method: :head)).run end |
#post(url, params = {}) ⇒ Typhoeus::Response
27 28 29 |
# File 'lib/cms_scanner/browser/actions.rb', line 27 def post(url, params = {}) forge_request(url, params.merge(method: :post)).run end |