105 references to TryGetValues
dotnet-openapi (1)
HttpClientWrapper.cs (1)
59if (_response.Headers.TryGetValues(BaseCommand.ContentDispositionHeaderName, out var disposition))
IIS.FunctionalTests (7)
Http2TrailersResetTests.cs (2)
118Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 136Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength);
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
144Assert.True(response.Content.Headers.TryGetValues("Content-Type", out var contentTypes));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (4)
519Assert.False(response.Headers.TryGetValues("EmptyHeader", out var headerValues)); 530Assert.True(response.Headers.TryGetValues("UnknownHeader", out var headerValues)); 533Assert.True(response.Content.Headers.TryGetValues(Net.Http.Headers.HeaderNames.ContentType, out headerValues)); 536Assert.True(response.Headers.TryGetValues("MultiHeader", out headerValues));
IISExpress.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
144Assert.True(response.Content.Headers.TryGetValues("Content-Type", out var contentTypes));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (4)
519Assert.False(response.Headers.TryGetValues("EmptyHeader", out var headerValues)); 530Assert.True(response.Headers.TryGetValues("UnknownHeader", out var headerValues)); 533Assert.True(response.Content.Headers.TryGetValues(Net.Http.Headers.HeaderNames.ContentType, out headerValues)); 536Assert.True(response.Headers.TryGetValues("MultiHeader", out headerValues));
Interop.FunctionalTests (1)
HttpClientHttp2InteropTests.cs (1)
571Assert.False(response.TrailingHeaders.TryGetValues("TestTrailer", out var none));
Microsoft.AspNetCore.Authentication.Test (9)
OpenIdConnect\OpenIdConnectEventTests.cs (3)
1015Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1041Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1067Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values));
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (3)
1015Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1041Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values)); 1067Assert.False(response.Headers.TryGetValues(HeaderNames.SetCookie, out var values));
TwitterTests.cs (3)
212Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 262Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie)); 369Assert.True(transaction.Response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookie));
Microsoft.AspNetCore.Diagnostics.Tests (17)
ExceptionHandlerTest.cs (17)
188Assert.True(response.Headers.TryGetValues("Pragma", out values)); 191Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 194Assert.False(response.Headers.TryGetValues("ETag", out values)); 244Assert.True(response.Headers.TryGetValues("Pragma", out values)); 247Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 250Assert.False(response.Headers.TryGetValues("ETag", out values)); 297Assert.True(response.Headers.TryGetValues("Cache-Control", out values)); 300Assert.True(response.Headers.TryGetValues("Pragma", out values)); 303Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 306Assert.True(response.Headers.TryGetValues("ETag", out values)); 371Assert.True(response.Headers.TryGetValues("Pragma", out values)); 374Assert.False(response.Headers.TryGetValues("Expires", out _)); 375Assert.False(response.Headers.TryGetValues("ETag", out _)); 439Assert.True(response.Headers.TryGetValues("Cache-Control", out values)); 442Assert.True(response.Headers.TryGetValues("Pragma", out values)); 445Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 448Assert.True(response.Headers.TryGetValues("ETag", out values));
Microsoft.AspNetCore.HeaderPropagation (2)
HeaderPropagationMessageHandler.cs (2)
61if (!request.Headers.TryGetValues(entry.OutboundHeaderName, out var _) && 62!(hasContent && request.Content!.Headers.TryGetValues(entry.OutboundHeaderName, out var _)))
Microsoft.AspNetCore.Identity.FunctionalTests (2)
MapIdentityApiTests.cs (2)
214Assert.True(loginResponse.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookieHeaders)); 1470Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookieHeaders));
Microsoft.AspNetCore.Mvc.FunctionalTests (8)
TempDataInCookiesTest.cs (5)
69Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out IEnumerable<string> setCookieValues)); 95Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out setCookieValues)); 128Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out IEnumerable<string> setCookieValues)); 151Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out setCookieValues)); 181Assert.True(response.Headers.TryGetValues(HeaderNames.SetCookie, out IEnumerable<string> setCookieValues));
TempDataInCookiesUsingCookieConsentTest.cs (1)
110if (response.Headers.TryGetValues("Set-Cookie", out values))
TempDataPropertyTest.cs (1)
163if (response.Headers.TryGetValues("Set-Cookie", out var values))
TempDataTestBase.cs (1)
266if (response.Headers.TryGetValues("Set-Cookie", out values))
Microsoft.AspNetCore.Mvc.Testing (1)
Handlers\CookieContainerHandler.cs (1)
52if (response.Headers.TryGetValues(HeaderNames.SetCookie, out var setCookieHeaders))
Microsoft.AspNetCore.ResponseCompression.Tests (7)
ResponseCompressionMiddlewareTest.cs (7)
755Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 808Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 877Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 941Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 1005Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out var md5)); 1217Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 1301Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (29)
Listener\ResponseBodyTests.cs (3)
46Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 70Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 95Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length");
ResponseBodyTests.cs (10)
36Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 123Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 155Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 180Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 202Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 226Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 306Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 338Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 366Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 393Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length");
ResponseHeaderTests.cs (2)
132Assert.True(response.Headers.TryGetValues("Custom-Header1", out var header)); 156var result = response.Content.Headers.TryGetValues("Content-Length", out values);
ResponseSendFileTests.cs (11)
74Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 93Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 112Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 132Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 151Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 208Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 228Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 249Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 270Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 299Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 322Assert.False(response.Content.Headers.TryGetValues("content-length", out var contentLength), "Content-Length");
ResponseTrailersTests.cs (3)
164Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 189Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 215Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
WebHostTests.cs (2)
256Assert.True(response1.Headers.TryGetValues("alt-svc", out var altSvcValues1)); 270Assert.True(response2.Headers.TryGetValues("alt-svc", out var altSvcValues2));
Microsoft.AspNetCore.Session.Tests (3)
SessionTests.cs (3)
57Assert.False(response.Headers.TryGetValues("Set-Cookie", out var _)); 94Assert.True(response.Headers.TryGetValues("Set-Cookie", out var values)); 149Assert.True(response.Headers.TryGetValues("Set-Cookie", out var values));
Microsoft.DotNet.Build.Tasks.Feed (2)
src\common\AzureStorageUtils.cs (2)
260bool md5HeaderAvailable = response.Headers.TryGetValues("Content-MD5", out var md5); 261bool lengthHeaderAvailable = response.Headers.TryGetValues("Content-Length", out var contentLength);
Microsoft.DotNet.VersionTools (1)
Automation\GitHubApi\GitHubClient.cs (1)
452if (response.Headers.TryGetValues(headerName, out headerValues))
Microsoft.Extensions.Http.Diagnostics (2)
Latency\Internal\HttpClientLatencyLogEnricher.cs (1)
61if (headers.TryGetValues(TelemetryConstants.ServerApplicationNameHeader, out var values))
Logging\Internal\HttpHeadersReader.cs (1)
102if (headers.TryGetValues(header, out var values))
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
274var hasHeader = response.Headers.TryGetValues("content-length", out headers);
ServerComparison.FunctionalTests (2)
ResponseCompressionTests.cs (1)
221return response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var values) ? values.FirstOrDefault() : null;
ResponseTests.cs (1)
270return response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out values) ? values.FirstOrDefault() : null;
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
99if (_httpResponseMessage.Content != null && _httpResponseMessage.Content.Headers.TryGetValues("Content-Type", out IEnumerable<string>? values))
System.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
150if (response.Headers.TryGetValues(HttpKnownHeaderNames.SecWebSocketProtocol, out IEnumerable<string>? subprotocolEnumerableValues)) 180if (options.DangerousDeflateOptions is not null && response.Headers.TryGetValues(HttpKnownHeaderNames.SecWebSocketExtensions, out IEnumerable<string>? extensions))