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.37.12 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.11 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.10 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.9 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.8 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.7 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.6 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.5 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.4 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.3 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.2 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37.1 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.37 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.36 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.35.1 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.35 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.34 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.33 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.32 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.31 lib/cms_scanner/browser/actions.rb