예제 #1
0
        public void Execute(bool force)
        {
            if (RefreshStatus == WebCallRefreshStatus.WaitingForRefreshCallback)
            {
                if (!force)
                {
                    return;
                }
                RefreshStatus = WebCallRefreshStatus.NotRefreshing;
            }
            if (force)
            {
                this.OnUnqueued(this, new WebCallUnqueuedEventArgs());
            }
            SessionDocument sessionDocument = database.GetSessionDocument(swid);

            if (!force && sessionDocument != null && sessionDocument.ProtocolVersion != 3)
            {
                this.OnUnauthorized(this, new WebCallUnauthorizedEventArgs("UNAUTHORIZED_MIX_SESSION"));
                return;
            }
            numAttempts++;
            bodyBytes       = Encoding.UTF8.GetBytes(body);
            bodyBytes       = WebCallEncryptor.Encrypt(bodyBytes);
            wwwCall         = wwwCallFactory.Create(uri, method, bodyBytes, headers, latencyWwwCallTimeout, maxWwwCallTimeout);
            wwwCall.OnDone += HandleWwwDone;
            wwwCall.Execute();
            logger.Debug(HttpLogBuilder.BuildRequestLog(wwwCall.RequestId, uri, method, headers, body));
        }
예제 #2
0
 private static string BuildRequestLog(Uri uri, int requestId)
 {
     return(HttpLogBuilder.BuildRequestLog(requestId, uri, HttpMethod.GET, emptyHeaders, string.Empty));
 }