def build_url(uri, opts={})
      path     = opts[:path] || ''
      query    = opts[:params] || {}
      fragment = opts[:fragment] || {}
      url = Addressable::URI.parse uri
      url.path = path
      url.query_values = query unless query.empty?
      url.fragment = Addressable::URI.form_encode(fragment) unless fragment.empty?
      url.to_s
    end
def build_url(uri, opts={})
      path     = opts[:path] || ''
      query    = opts[:params] || {}
      fragment = opts[:fragment] || {}
      url = Addressable::URI.parse uri
      url.path = path
      url.query_values = query unless query.empty?
      url.fragment = Addressable::URI.form_encode(fragment) unless fragment.empty?
      url.to_s
    end
convenience method to build response URI