def processRequest(self, Method=None, ContentLength=None, *args, **kwargs):
     if Method != 'POST':
         return
     result = yield http.readRe('(?P<BODY>.*)', ContentLength)
     body = result['BODY']
     yield http.ok()
     yield http.headers('a', 'b')
     yield 'Hello ' + body
 def processRequest(self, Method=None, ContentLength=None, *args, **kwargs):
     if Method != 'POST':
         return
     result = yield http.readRe('(?P<BODY>.*)', ContentLength)
     body = result['BODY']
     yield http.ok()
     yield http.headers('a', 'b')
     yield 'Hello ' + body
 def processRequest(this, Method=None, RequestURI=None, ContentLength=0, *args, **kwargs):
     yield http.ok()
     if Method == 'POST':
         @autostart
         def devNull():
             while True: yield
         yield http.copyBytes(ContentLength, devNull())
     wrong = yield 'Path = ' + str(RequestURI)
     self.assertEquals(None, wrong) # Second request must not end up here
     done.append(True)
 def processRequest(this, Method=None, RequestURI=None, ContentLength=0, *args, **kwargs):
     yield http.ok()
     if Method == 'POST':
         @autostart
         def devNull():
             while True: yield
         yield http.copyBytes(ContentLength, devNull())
     wrong = yield 'Path = ' + str(RequestURI)
     self.assertEquals(None, wrong) # Second request must not end up here
     done.append(True)
 def processRequest(this, Method, RequestURI, HTTPVersion, Headers, **kwargs):
     length = int(Headers['content-length'].keys()[0])
     @autostart
     def destination(result):
         while True:
             result += (yield)
     result = []
     yield http.copyBytes(length, destination(result))
     self.assertEquals('This is a body', ''.join(result))
     yield http.ok()
     yield http.headers('a', 'b')
     yield 'Hello ' + ''.join(result)
 def processRequest(this, Method, RequestURI, HTTPVersion, Headers, **kwargs):
     length = int(Headers['content-length'].keys()[0])
     @autostart
     def destination(result):
         while True:
             result += (yield)
     result = []
     yield http.copyBytes(length, destination(result))
     self.assertEquals('This is a body', ''.join(result))
     yield http.ok()
     yield http.headers('a', 'b')
     yield 'Hello ' + ''.join(result)
Beispiel #7
0
 def processRequest(self,
                    Method=None,
                    RequestURI=None,
                    HTTPVersion=None,
                    Headers=None,
                    fragment=None,
                    netloc=None,
                    query=None,
                    path=None,
                    scheme=None):
     yield http.ok()
     yield http.noheaders()
     yield 'Echo ' + RequestURI
     done.append(True)
Beispiel #8
0
 def handle(self):
     yield http.ok()
     yield http.noheaders()
     yield 'this was the GET handler'
Beispiel #9
0
 def handle(this, ContentLength):
     body = yield http.readRe('(?P<BODY>.*)', ContentLength)
     self.assertEquals('XXYYZZ', body['BODY'])
     yield http.ok()
     yield http.noheaders()
     yield 'this was the post handler'
 def processRequest(this, **kwargs):
     yield http.ok()
     yield http.noheaders()
     yield 'Bye'
 def handle(self):
     yield http.ok()
     yield http.noheaders()
     yield 'this was the GET handler'
 def handle(this, ContentLength):
     body = yield http.readRe('(?P<BODY>.*)', ContentLength)
     self.assertEquals('XXYYZZ', body['BODY'])
     yield http.ok()
     yield http.noheaders()
     yield 'this was the post handler'
 def processRequest(self, Method=None, RequestURI=None, HTTPVersion=None, Headers=None, fragment=None, netloc=None, query=None, path=None, scheme=None):
     yield http.ok()
     yield http.noheaders()
     yield 'Echo ' + RequestURI
     done.append(True)
Beispiel #14
0
 def processRequest(self, *args, **kwargs):
     yield http.ok()
     yield http.headers('Content-Length', 6)
     yield 'Hello!'
Beispiel #15
0
 def processRequest(self, *args, **kwargs):
     yield http.ok()
     yield http.headers('Content-Length', 6)
     yield 'Hello!'
Beispiel #16
0
 def processRequest(this, Method, RequestURI, HTTPVersion, Headers,
                    *args, **kwargs):
     yield http.ok()
     yield http.headers('Content-Length', 3)
     yield 'Bye'
Beispiel #17
0
 def processRequest(this, **kwargs):
     yield http.ok()
     yield http.noheaders()
     yield 'Bye'
 def processRequest(this, Method, RequestURI, HTTPVersion, Headers, *args, **kwargs):
     yield http.ok()
     yield http.headers('Content-Length', 3)
     yield 'Bye'