本文整理汇总了Python中Yowsup.Common.debugger.Debugger.stdDebug方法的典型用法代码示例。如果您正苦于以下问题:Python Debugger.stdDebug方法的具体用法?Python Debugger.stdDebug怎么用?Python Debugger.stdDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yowsup.Common.debugger.Debugger
的用法示例。
在下文中一共展示了Debugger.stdDebug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sendRequest
# 需要导入模块: from Yowsup.Common.debugger import Debugger [as 别名]
# 或者: from Yowsup.Common.debugger.Debugger import stdDebug [as 别名]
def sendRequest(host, port, path, headers, params, reqType="GET"):
params = urlencode(params);
path = path + "?"+ params if reqType == "GET" and params else path
WADebug.stdDebug(reqType)
WADebug.stdDebug(headers);
WADebug.stdDebug(params);
WADebug.stdDebug("Opening connection to %s" % host);
conn = httplib.HTTPSConnection(host ,port) if port == 443 else httplib.HTTPConnection(host ,port)
WADebug.stdDebug("Requesting %s" % path)
conn.request(reqType, path, params, headers);
response = conn.getresponse()
#WADebug.stdDebug(response)
return response
示例2: sendRequest
# 需要导入模块: from Yowsup.Common.debugger import Debugger [as 别名]
# 或者: from Yowsup.Common.debugger.Debugger import stdDebug [as 别名]
def sendRequest(host, port, path, headers, params, reqType="GET"):
params = urlencode(params);
path = path + "?"+ params if reqType == "GET" and params else path
if len(headers):
WADebug.stdDebug(headers)
if len(params):
WADebug.stdDebug(params)
WADebug.stdDebug("Opening connection to %s" % host);
conn = WARequest.getConn(host, port)
if conn is None:
conn = WARequest.getConn(host, port, True)
WADebug.stdDebug("Sending %s request to %s" % (reqType, path))
conn.request(reqType, path, params, headers);
response = conn.getresponse()
return response