// Token: 0x0600020F RID: 527 RVA: 0x000081AC File Offset: 0x000063AC internal static DownloadResult SendRestRequest(string requestMethod, string requestUri, OwaIdentity identity, Stream requestStream, DataProviderCallLogEvent logEvent, string spCallName) { DownloadResult result; using (HttpClient httpClient = new HttpClient()) { HttpSessionConfig httpSessionConfig = new HttpSessionConfig { Method = requestMethod, Credentials = OauthUtils.GetOauthCredential(identity.GetOWAMiniRecipient()), UserAgent = OneDriveProUtilities.UserAgentString, RequestStream = requestStream, ContentType = "application/json;odata=verbose", PreAuthenticate = true }; httpSessionConfig.Headers = OneDriveProUtilities.GetOAuthRequestHeaders(); if (logEvent != null) { logEvent.TrackSPCallBegin(); } ICancelableAsyncResult cancelableAsyncResult = httpClient.BeginDownload(new Uri(requestUri), httpSessionConfig, null, null); cancelableAsyncResult.AsyncWaitHandle.WaitOne(); DownloadResult downloadResult = httpClient.EndDownload(cancelableAsyncResult); if (logEvent != null) { string correlationId = (downloadResult.ResponseHeaders == null) ? null : downloadResult.ResponseHeaders["SPRequestGuid"]; logEvent.TrackSPCallEnd(spCallName, correlationId); } result = downloadResult; } return(result); }
// Token: 0x06000212 RID: 530 RVA: 0x00008570 File Offset: 0x00006770 internal static void ExecuteQueryWithTraces(UserContext userContext, IClientContext context, DataProviderCallLogEvent logEvent, string spCallName) { try { if (logEvent != null) { logEvent.TrackSPCallBegin(); } context.ExecuteQuery(); } finally { if (logEvent != null) { logEvent.TrackSPCallEnd(spCallName, context.TraceCorrelationId); } OneDriveProUtilities.SendPendingGetNotification(userContext, new AttachmentOperationCorrelationIdNotificationPayload { CorrelationId = context.TraceCorrelationId, SharePointCallName = spCallName }); } }