def _MakeRequest(host, path, request_dict):
 from viewfinder.backend.www.basic_auth import BasicAuthHandler
 if BasicAuthHandler._HTTP_TEST_CASE:
  url = ('http://%s/admin%s' % (host, path))
 else:
  url = ('https://%s/admin%s' % (host, path))
 req = urllib2.Request(url)
 req.add_data(json.dumps(request_dict))
 req.add_header('Content-Type', 'application/json')
 return req

def _MakeRequest ( host , path , request_dict ) : from viewfinder . backend . www . basic_auth import BasicAuthHandler if BasicAuthHandler . _HTTP_TEST_CASE : url = ( 'http://%s/admin%s' % ( host , path ) ) else : url = ( 'https://%s/admin%s' % ( host , path ) ) req = urllib2 . Request ( url ) req . add_data ( json . dumps ( request_dict ) ) req . add_header ( 'Content-Type' , 'application/json' ) return req
gets a url to the specified "path" to the api endpoint available at "host" .