Esempio 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)
Esempio 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)
Esempio 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'
Esempio 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)