Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing.OnBeginForGetResponse C# (CSharp) Method

OnBeginForGetResponse() public method

On begin callback for GetResponse.
public OnBeginForGetResponse ( object thisObj ) : object
thisObj object This object.
return object
        public object OnBeginForGetResponse(object thisObj)
        {
            return this.OnBegin(thisObj, false);
        }

Usage Example

        public void RddTestHttpProcessingProfilerOnBeginSkipsAddingSourceHeaderPerConfig()
        {
            string hostnamepart = "partofhostname";
            string url          = string.Format(CultureInfo.InvariantCulture, "http://hostnamestart{0}hostnameend.com/path/to/something?param=1", hostnamepart);
            var    request      = WebRequest.Create(new Uri(url));

            Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
            Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());

            var httpProcessingProfiler = new ProfilerHttpProcessing(this.configuration, null, new ObjectInstanceBasedOperationHolder(), /*setCorrelationHeaders*/ false, new List <string>(), RandomAppIdEndpoint);

            httpProcessingProfiler.OnBeginForGetResponse(request);
            Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
            Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());

            ICollection <string> exclusionList = new SanitizedHostList()
            {
                "randomstringtoexclude", hostnamepart
            };

            httpProcessingProfiler = new ProfilerHttpProcessing(this.configuration, null, new ObjectInstanceBasedOperationHolder(), /*setCorrelationHeaders*/ true, exclusionList, RandomAppIdEndpoint);
            httpProcessingProfiler.OnBeginForGetResponse(request);
            Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
            Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());
        }
All Usage Examples Of Microsoft.ApplicationInsights.DependencyCollector.Implementation.ProfilerHttpProcessing::OnBeginForGetResponse