def url_encode(str)
      encoded_string = ""
      str.each_char do |char|
        case char
        when "+"
          encoded_string << "%2b"
        when "="
          encoded_string << "%3d"
        when "?"
          encoded_string << "%3f"
        when "&"
          encoded_string << "%26"
        when "%"
          encoded_string << "%25"
        when ","
          encoded_string << "%2C"
        else
          encoded_string << char
        end
      end
      encoded_string
    end
def url_encode(str)
      encoded_string = ""
      str.each_char do |char|
        case char
        when "+"
          encoded_string << "%2b"
        when "="
          encoded_string << "%3d"
        when "?"
          encoded_string << "%3f"
        when "&"
          encoded_string << "%26"
        when "%"
          encoded_string << "%25"
        when ","
          encoded_string << "%2C"
        else
          encoded_string << char
        end
      end
      encoded_string
    end
Creates a new HTTP instance which will automatically handle authenting to the RETS server.