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.41.5 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.41.4 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.41.3 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.41.2 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.41.1 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.41.0 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.40.3 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.40.2 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.40.1 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.40 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.39.4 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.39.3 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.39.2 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.39.1 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.39.0 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.38.4 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.38.3 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.38.2 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.38.1 lib/cms_scanner/browser/actions.rb
cms_scanner-0.0.38.0 lib/cms_scanner/browser/actions.rb