Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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'
Ejemplo n.º 4
0
 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)