def gethandler(*args, **kwargs): try: response = yield httprequest(method='GET', host='localhost', port=port, request='/path', headers={'Content-Type': 'text/plain', 'Content-Length': 0, 'Host': 'localhost'}, timeout=timeout, ) responses.append(response) except TimeoutException, e: responses.append(e)
def gethandler(*args, **kwargs): response = 'no response yet' try: response = yield httprequest(method='MYMETHOD', host='localhost', port=port, request='/path', headers={'Content-Type': 'text/plain', 'Content-Length': 0}, prio=4 ) finally: responses.append(response)
def gethandler(*args, **kwargs): response = 'no response yet' try: response = yield httprequest(method='MYMETHOD', host='localhost', port=port, request='/path', headers={ 'Content-Type': 'text/plain', 'Content-Length': 0 }, prio=4) finally: responses.append(response) yield 'HTTP/1.0 200 OK\r\n\r\n'
def gethandler(*args, **kwargs): try: response = yield httprequest( method='GET', host='localhost', port=port, request='/path', headers={ 'Content-Type': 'text/plain', 'Content-Length': 0, 'Host': 'localhost' }, timeout=timeout, ) responses.append(response) except TimeoutException, e: responses.append(e)