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: gemcutter_utilities.rb
    path of file: ./repos/ruby-packer/ruby/lib/rubygems
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require 'rubygems/remote_fetcher'
require 'rubygems/text'

##
# Utility methods 
    
  def rubygems_api_request(method, path, host = nil, allowed_push_host = nil, &block)
    require 'net/http'

    self.host = host if host
    unless self.host
      alert_error "You must specify a gem server"
      terminate_interaction(ERROR_CODE)
    end