def query_http_server(host, port, path=''):
 def query():
  req = get('http://{host}:{port}{path}'.format(host=host, port=port, path=path), timeout=SOCKET_TIMEOUT_FOR_POLLING, persistent=False)
  def failed(failure):
   Message.new(message_type=u'acceptance:http_query_failed', reason=unicode(failure)).write()
   return False
  req.addCallbacks(content, failed)
  return req
 d = verify_socket(host, port)
 d.addCallback((lambda _: loop_until(reactor, query)))
 return d

def query_http_server ( host , port , path = '' ) : def query ( ) : req = get ( 'http://{host}:{port}{path}' . format ( host = host , port = port , path = path ) , timeout = SOCKET_TIMEOUT_FOR_POLLING , persistent = False ) def failed ( failure ) : Message . new ( message_type = u'acceptance:http_query_failed' , reason = unicode ( failure ) ) . write ( ) return False req . addCallbacks ( content , failed ) return req d = verify_socket ( host , port ) d . addCallback ( ( lambda _ : loop_until ( reactor , query ) ) ) return d
return the response from a http server .