Esempio n. 1
0
 def __sendRequest(self, method, params, handler):
     id = pygwt.getNextHashId()
     msg = {"id":id, "method":method, "params":params}
     msg_data = self.parser.encode(msg)
     
     request_info = JSONRequestInfo(id, method, handler)
     if not HTTPRequest().asyncPost(self.url, msg_data, JSONResponseTextHandler(request_info)):
         return -1
     return id
    def __sendRequest(self, method, params, handler):
        id = pygwt.getNextHashId()
        msg = {"id": id, "method": method, "params": params}
        msg_data = self.parser.encode(msg)

        request_info = JSONRequestInfo(id, method, handler)
        if not HTTPRequest().asyncPost(self.url, msg_data,
                                       JSONResponseTextHandler(request_info)):
            return -1
        return id
Esempio n. 3
0
    def sendRequest(self, method, params, handler):
        from jsonrpc.json import dumps
        id = pygwt.getNextHashId()
        msg = {"id":id, "method":method, "params":params}
        msg_data = dumps(msg)

        request_info = JSONRequestInfo(id, method, handler)
        if not HTTPRequest().asyncPost(self.url, msg_data,
                                       JSONResponseTextHandler(request_info),
                                       content_type="text/x-json"):
            return -1
        return id