本文整理汇总了Python中lib.Util.reportHTTPResponse方法的典型用法代码示例。如果您正苦于以下问题:Python Util.reportHTTPResponse方法的具体用法?Python Util.reportHTTPResponse怎么用?Python Util.reportHTTPResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.Util
的用法示例。
在下文中一共展示了Util.reportHTTPResponse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __processRequest
# 需要导入模块: from lib import Util [as 别名]
# 或者: from lib.Util import reportHTTPResponse [as 别名]
def __processRequest(self):
msg = self.__createMessage()
service = config.endpoint.get('subscribe')
connection=str(os.getenv("DEFAULT_HOST", "localhost") + ":" + os.getenv("DEFAULT_PORT", "9581"))
ch = CH.CommHandler(connection, service)
ch.process(msg)
if not ch.isGoodStatus():
util.reportHTTPResponse(ch.formatResponse())
retVal = self.__processResponse(ch.getContents())
return retVal
示例2: __submitRequestMessage
# 需要导入模块: from lib import Util [as 别名]
# 或者: from lib.Util import reportHTTPResponse [as 别名]
def __submitRequestMessage(self,msg):
try:
runner = self.commands.get('runner')
service = config.endpoint.get(runner)
# send the request to the server
connection=str(os.getenv("DEFAULT_HOST", "localhost") + ":" + os.getenv("DEFAULT_PORT", "9581"))
ch = CH.CommHandler(connection,service)
ch.process(msg)
if not ch.isGoodStatus():
util.reportHTTPResponse(ch.formatResponse())
return None
return ch.getContents()
except Exception,e:
raise CH.CommError("Unable to submit request to server",e)