public string GetBytes(string url, EventHandlerHTTPBytes bytesCallback, EventHandlerServiceError onError = null, EventHandlerServiceTimeOut onTimeOut = null, int timeOut = 0)
        {
            HTTPRequest request = new HTTPRequest();
            request.url = url;
            request.transactionId = UCSS.GenerateTransactionId(Common.Md5Sum(url));
            request.bytesCallback = bytesCallback;
            request.onError = onError;
            request.onTimeOut = onTimeOut;
            request.timeOut = timeOut;

            StartCoroutine(RunGetDataCoroutine(request));

            return request.transactionId;
        }
Exemple #2
0
        public string GetBytes(string url, EventHandlerHTTPBytes bytesCallback, EventHandlerServiceError onError = null, EventHandlerServiceTimeOut onTimeOut = null, int timeOut = 0)
        {
            HTTPRequest request = new HTTPRequest();

            request.url           = url;
            request.transactionId = UCSS.GenerateTransactionId(Common.Md5Sum(url));
            request.bytesCallback = bytesCallback;
            request.onError       = onError;
            request.onTimeOut     = onTimeOut;
            request.timeOut       = timeOut;

            request.coroutineFactory = RunGetDataCoroutineFactory(request);
            request.coroutine        = StartCoroutine(request.coroutineFactory());
            return(request.transactionId);
        }
Exemple #3
0
        public string PostBytes(string url, byte[] bytes, Dictionary <string, string> headers, EventHandlerHTTPBytes bytesCallback, EventHandlerServiceError onError = null, EventHandlerServiceTimeOut onTimeOut = null, int timeOut = 0)
        {
            HTTPRequest request = new HTTPRequest();

            request.url           = url;
            request.bytes         = bytes;
            request.headers       = headers;
            request.transactionId = UCSS.GenerateTransactionId(Common.Md5Sum(url));
            request.bytesCallback = bytesCallback;
            request.onError       = onError;
            request.onTimeOut     = onTimeOut;
            request.timeOut       = timeOut;

            request.coroutineFactory = RunPostBytesCoroutineFactory(request);
            request.coroutine        = StartCoroutine(request.coroutineFactory());
            return(request.transactionId);
        }