def head_and_get(path, codes = [200], params = {})
      url_to_get  = url(path)
      head_params = (params[:head] || {}).merge(head_or_get_params)

      head_res = NS::Browser.forge_request(url_to_get, head_params).run

      codes.include?(head_res.code) ? NS::Browser.get(url_to_get, params[:get] || {}) : head_res
    end
def head_and_get(path, codes = [200], params = {})
      url_to_get  = url(path)
      head_params = (params[:head] || {}).merge(head_or_get_params)

      head_res = NS::Browser.forge_request(url_to_get, head_params).run

      codes.include?(head_res.code) ? NS::Browser.get(url_to_get, params[:get] || {}) : head_res
    end
Perform a HEAD request to the path provided, then if its response code
 is in the array of codes given, a GET is done and the response returned. Otherwise the
 HEAD response is returned.

 @param [ String ] path
 @param [ Array<String> ] codes
 @param [ Hash ] params The requests params
 @option params [ Hash ] :head Request params for the HEAD
 @option params [ hash ] :get Request params for the GET

 @return [ Typhoeus::Response ]