(self,
                 processor,
                 server_address,
                 iprot_factory,
                 server_class=http_server.HTTPServer)
Set up protocol factories and HTTP server.
        See http.server for server_address.
        See TServer for protocol factories.
Set up protocol factories and HTTP server.
        See http.server for server_address.
        See TServer for protocol factories.
Set up protocol factories and HTTP server . See http . server for server_address . See TServer for protocol factories .
def __init__(self,
                 processor,
                 server_address,
                 iprot_factory,
                 server_class=http_server.HTTPServer):
        """Set up protocol factories and HTTP server.
        See http.server for server_address.
        See TServer for protocol factories.
        """
        TServer.__init__(self, processor, trans=None,
                         itrans_factory=None, iprot_factory=iprot_factory,
                         otrans_factory=None, oprot_factory=None)

        thttpserver = self

        class RequestHander(http_server.BaseHTTPRequestHandler):
            # Don't care about the request path.

            def do_POST(self):
                # Don't care about the request path.
                itrans = TFileObjectTransport(self.rfile)
                otrans = TFileObjectTransport(self.wfile)
                itrans = TBufferedTransport(
                    itrans, int(self.headers['Content-Length']))
                otrans = TMemoryBuffer()
                iprot = thttpserver.iprot_factory.get_protocol(itrans)
                oprot = thttpserver.oprot_factory.get_protocol(otrans)
                try:
                    thttpserver.processor.process(iprot, oprot)
                except ResponseException as exn:
                    exn.handler(self)
                else:
                    self.send_response(200)
                    self.send_header("content-type", "application/x-thrift")
                    self.end_headers()
                    self.wfile.write(otrans.getvalue())

        self.httpd = server_class(server_address, RequestHander)
def __init__ ( self , processor , server_address , iprot_factory , server_class = http_server . HTTPServer ) : TServer . __init__ ( self , processor , trans = None , itrans_factory = None , iprot_factory = iprot_factory , otrans_factory = None , oprot_factory = None ) thttpserver = self class RequestHander ( http_server . BaseHTTPRequestHandler ) : # Don't care about the request path. def do_POST ( self ) : # Don't care about the request path. itrans = TFileObjectTransport ( self . rfile ) otrans = TFileObjectTransport ( self . wfile ) itrans = TBufferedTransport ( itrans , int ( self . headers [ 'Content-Length' ] ) ) otrans = TMemoryBuffer ( ) iprot = thttpserver . iprot_factory . get_protocol ( itrans ) oprot = thttpserver . oprot_factory . get_protocol ( otrans ) try : thttpserver . processor . process ( iprot , oprot ) except ResponseException as exn : exn . handler ( self ) else : self . send_response ( 200 ) self . send_header ( "content-type" , "application/x-thrift" ) self . end_headers ( ) self . wfile . write ( otrans . getvalue ( ) ) self . httpd = server_class ( server_address , RequestHander )