module RSolr::HTTPClient::Util

def build_url(url='', params={}, string_query='')

result of "url" and "params".
"string_query" is an extra query string that will be appended to the
"params" is an optional hash of GET style query params
"url" is the base url
creates and returns a url as a string
def build_url(url='', params={}, string_query='')
  queries = [string_query, hash_to_query(params)]
  queries.delete_if{|i| i.to_s.empty?}
  url += "?#{queries.join('&')}" unless queries.empty?
  url
end