Sha256: 4a143cd03c5220f122b385db0ffd9821a3af2e8a1fc18f9080538568848ca608

Contents?: true

Size: 1.16 KB

Versions: 69

Compression:

Stored size: 1.16 KB

Contents

module CMSScanner
  class Browser
    # Browser Actions (get, post etc)
    module Actions
      # @param [ String ] url
      # @param [ Hash ] params
      #
      # @return [ Typhoeus::Response ]
      def get(url, params = {})
        process(url, params.merge(method: :get))
      end

      # @param [ String ] url
      # @param [ Hash ] params
      #
      # @return [ Typhoeus::Response ]
      def post(url, params = {})
        process(url, params.merge(method: :post))
      end

      # @param [ String ] url
      # @param [ Hash ] params
      #
      # @return [ Typhoeus::Response ]
      def head(url, params = {})
        process(url, params.merge(method: :head))
      end

      # @param [ String ] url
      # @param [ Hash ] params
      #
      # @return [ Typhoeus::Response ]
      def get_and_follow_location(url, params = {})
        get(url, params.merge(followlocation: true))
      end

      protected

      # @param [ String ] url
      # @param [ Hash ] params
      #
      # @return [ Typhoeus::Response ]
      def process(url, params)
        Typhoeus::Request.new(url, NS::Browser.instance.request_params(params)).run
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
cms_scanner-0.0.30 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.29 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.28 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.27 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.26 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.25 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.24 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.23 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.22 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.21 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.20 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.19 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.18 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.17 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.16 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.15 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.14 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.13 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.12 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.11 lib/cms_scanner/browser/actions.rb