You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: request.rb
    path of file: ./repos/metasploit-framework/plugins
    
    the code of the file until where you have to start completion: require 'uri'

module Msf
  class Plugin::Requests < Msf::Plugin

    class ConsoleCommandDispatcher
      include Msf::Ui::Console::CommandDispatcher

      HELP_REGEX = /^-?-h(?:elp)?$/.freeze

      def name
        'Request'
      end

      def commands
        {
          'request' => "Make a request of the specified type (#{types.join(', ')})"
        }
      end

      # Dynamically determine the types of requests that are supported based on
      # methods prefixed with "parse_args".
      #
      # @return [Array<String>] The supported request types.
      def types
        parse_methods = public_methods.select { |m| m.to_s =~ /^parse_args_/ }
        parse_methods.collect { |m| m.to_s.split('_').slice(2..-1).join('_') }
      end

      # The main handler for the request command.
      #
      # @param args [Array<String>] The array of arguments provided by the user.
      # @return [nil]
      def cmd_request(*args)
        # short circuit the whole deal if they need help
        return help if args.empty?
        return help if args.length == 1 && args.first =~ HELP_REGEX

        # detect the request type from the uri which must be the last arg given
        uri = args.last
        if uri && uri =~ %r{^[A-Za-z]{3,5}://}
          type = uri.split('://', 2).first
        else
          print_error('The last argument must be a valid and supported URI')
          return help
        end

        # parse options
        opts, opt_parser = parse_args(args, type)
        if opts && opt_parser
          # handle any "global" options
          if opts[:output_file]
            begin
              opts[:output_file] = File.new(opts[:output_file], 'w')
            rescue ::Errno::EACCES, Errno::EISDIR, Errno::ENOTDIR
              return help(opt_parser, 'Failed to open the specified file for output')
            end
          end
          # hand off the actual request to the appropriate request handler
          handler_method = "handle_request_#{type}".to_sym
          if respond_to?(handler_method)
            # call the appropriate request handl
    
      def handle_request_https(opts, opt_parser)
        # let http do it
        handle_request_http(opts, opt_parser)
      end

      # Perform an HTTP request based on the user specified options.
      #
      # @param opts [Hash] The options to use for making the HTTP request.
      # @option opts [String] :auth_username An optional username to use with
      #   basic authentication.
      # @option opts [String] :auth_password An optional password to use with
      #   basic authentication. This is only used when :auth_username is
      #   specified.
      # @option opts [String] :data Any data to include within the body of the
      #   request. Often used with the POST HTTP method.
      # @option opts [Hash] :headers A hash of additional headers to include in
      #   the request.
      # @option opts [String] :method The HTTP method to use in the request.
      # @option opts [#write] :output_file A file to write the response data to.
      # @option opts [Boolean] :print_body Whether or not to print the body of the
      #   response.
      # @option opts [Boolean] :print_headers Whether or not to print the headers
      #   of the response.
      # @option opts [String] :ssl_version The version of SSL to use if the
      #   request scheme is HTTPS.
      # @option opts [String] :uri The target uri to request.
      # @option opts [String] :user_agent The value to use in the User-Agent
      #   header of the request.
      # @param opt_parser [Rex::Parser::Arguments] the argument parser for the
      #   request type.
      # @return [nil]
      def handle_request_http(opts, _opt_parser)
        uri = opts[:uri]
        http_client = Rex::Proto::Http::Client.new(
          uri.host,
          uri.port,
          { 'Msf' => framework },
          uri.scheme == 'https',
          opts[:ssl_version]
        )

        if opts[:auth_username]
          auth_str = opts[:auth_username] + ':' + opts[:auth_password]
          auth_str = 'Basic ' + Rex::Text.encode_base64(auth_str)
          opts[:headers]['Authorization'] = auth_str
        end

        uri.path = '/' if uri.path.empty?

        begin
          http_client.connect
          req = http_client.request_cgi(
            'agent' => opts[:user_agent],
            'data' => opts[:data],
            'headers' => opts[:headers],
            'method' => opts[:method],
            'password' => opts[:auth_password],
            'query' => uri.query,
            'uri' => uri.path,
            'username' => opts[:auth_username],
            'version' => opts[:version]
          )

          response = http_client.send_recv(req)
        rescue ::OpenSSL::SSL::SSLError
          print_error('Encountered an SSL error')
        rescue ::Errno::ECONNRESET
          print_error('The connection was reset by the peer')
        rescue ::EOFError, Errno::ETIMEDOUT, Rex::ConnectionError, ::Timeout::Error
          print_error('Encountered an error')
        ensure
          http_client.close
        end