Пример #1
0
 def Call(self, isopen=True):
     self.transport = THttpClient.THttpClient(self.host)
     self.transport.setCustomHeaders(self.headers)
     self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
     self._call  = CallService.Client(self.protocol)
     if isopen:
         self.transport.open()
     return self._call
Пример #2
0
    def Call(self, isopen=True):
        call_transport = THttpClient(self.host, customThrift=self.customThrift)
        call_transport.setCustomHeaders(self.headers)
        call_protocol = TCompactProtocol.TCompactProtocol(call_transport)
        _call  = CallService.Client(call_protocol)

        if isopen:
            call_transport.open()

        return _call
Пример #3
0
 def __init__(self, authToken):
     Config.__init__(self)
     self.transport = THttpClient.THttpClient(self.LINE_HOST_DOMAIN, None,
                                              self.LINE_API_QUERY_PATH_FIR)
     self.transport.path = self.LINE_AUTH_QUERY_PATH
     self.transport.setCustomHeaders({
         "X-Line-Application": self.APP_NAME,
         "User-Agent": self.USER_AGENT,
         "X-Line-Access": authToken
     })
     self.protocol = TCompactProtocol.TCompactProtocol(self.transport)
     self.client = CallService.Client(self.protocol)
     self.transport.path = self.LINE_CALL_QUERY_PATH
     self.transport.open()