98 writes to Version
HttpStress (11)
Program.cs (11)
122using (var req = new HttpRequestMessage(HttpMethod.Get, serverUri + path) { Version = httpVersion }) 174using (var req = new HttpRequestMessage(HttpMethod.Get, serverUri) { Version = httpVersion }) 203using (var req = new HttpRequestMessage(HttpMethod.Get, serverUri + "/headers") { Version = httpVersion }) 215using (var req = new HttpRequestMessage(HttpMethod.Get, serverUri) { Version = httpVersion }) 243using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringDuplexContent(content) }) 257using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri + "/duplex") { Version = httpVersion, Content = new StringDuplexContent(content) }) 271using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri + "/duplexSlow") { Version = httpVersion, Content = new ByteAtATimeNoLengthContent(Encoding.ASCII.GetBytes(content)) }) 285using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringContent(content) }) 302using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringContent(content) }) 325using (var req = new HttpRequestMessage(HttpMethod.Head, serverUri) { Version = httpVersion }) 347using (var req = new HttpRequestMessage(HttpMethod.Put, serverUri) { Version = httpVersion, Content = new StringContent(content) })
IIS.FunctionalTests (1)
Http3Tests.cs (1)
68request.Version = HttpVersion.Version11;
InMemory.FunctionalTests (7)
EventSourceTests.cs (1)
191Version = new Version(2, 0),
Http2\Http2EndToEndTests.cs (1)
68Version = new Version(2, 0),
KestrelMetricsTests.cs (5)
570Version = new Version(2, 0), 649Version = new Version(2, 0), 727Version = new Version(2, 0), 808Version = new Version(2, 0), 896Version = new Version(2, 0),
Interop.FunctionalTests (46)
Http2\Http2RequestTests.cs (4)
127request1.Version = HttpVersion.Version20; 184request1.Version = HttpVersion.Version20; 210request.Version = HttpVersion.Version11; 294request.Version = HttpVersion.Version20;
Http3\Http3RequestTests.cs (34)
90request1.Version = HttpVersion.Version30; 149request.Version = GetProtocol(protocol); 251request.Version = GetProtocol(protocol); 295request.Version = GetProtocol(protocol); 376request.Version = GetProtocol(protocol); 419request.Version = HttpVersion.Version30; 490request.Version = GetProtocol(protocol); 561request.Version = GetProtocol(protocol); 620request.Version = GetProtocol(HttpProtocols.Http3); 676request.Version = GetProtocol(protocol); 726request.Version = HttpVersion.Version30; 816request.Version = HttpVersion.Version30; 852request1.Version = HttpVersion.Version30; 863request2.Version = HttpVersion.Version30; 1015request.Version = GetProtocol(protocol); 1112request.Version = GetProtocol(protocol); 1258request.Version = GetProtocol(protocol); 1317request.Version = GetProtocol(protocol); 1371request.Version = HttpVersion.Version30; 1423request1.Version = HttpVersion.Version30; 1433request2.Version = HttpVersion.Version30; 1490request1.Version = HttpVersion.Version30; 1501request2.Version = HttpVersion.Version30; 1542request1.Version = HttpVersion.Version30; 1560request2.Version = HttpVersion.Version30; 1604request1.Version = HttpVersion.Version30; 1664request1.Version = HttpVersion.Version30; 1720request1.Version = HttpVersion.Version30; 1840request.Version = HttpVersion.Version30; 1886request1.Version = HttpVersion.Version30; 1963request1.Version = HttpVersion.Version30; 2040request.Version = GetProtocol(protocol); 2140request.Version = GetProtocol(protocol); 2193request.Version = GetProtocol(HttpProtocols.Http3);
Http3\Http3TlsTests.cs (7)
57request.Version = HttpVersion.Version30; 104request.Version = HttpVersion.Version30; 146request.Version = HttpVersion.Version30; 195request.Version = HttpVersion.Version30; 245request.Version = HttpVersion.Version30; 323request.Version = HttpVersion.Version30; 474request.Version = HttpVersion.Version30;
HttpClientHttp2InteropTests.cs (1)
1700Version = HttpVersion.Version20,
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
221requestMessage.Version = Backchannel.DefaultRequestVersion;
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
OpenIdConnectHandler.cs (3)
598requestMessage.Version = Backchannel.DefaultRequestVersion; 993requestMessage.Version = Backchannel.DefaultRequestVersion; 1059requestMessage.Version = Backchannel.DefaultRequestVersion;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
Http3Tests.cs (1)
76request.Version = HttpVersion.Version11;
Listener\ResponseHeaderTests.cs (2)
345request.Version = new Version(1, 0); 359request.Version = new Version(1, 0);
ResponseHeaderTests.cs (2)
173request.Version = new Version(1, 0); 200request.Version = new Version(1, 0);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
WebHostTests.cs (2)
80request.Version = HttpVersion.Version30; 353request1.Version = HttpVersion.Version30;
Microsoft.AspNetCore.TestHost.Tests (8)
TestClientTests.cs (8)
197httpRequest.Version = new Version(2, 0); 305httpRequest.Version = new Version(2, 0); 362httpRequest.Version = new Version(2, 0); 424httpRequest.Version = new Version(2, 0); 471httpRequest.Version = new Version(2, 0); 522httpRequest.Version = new Version(2, 0); 979request.Version = new Version(2, 0); 1006request.Version = new Version(3, 0);
Microsoft.Extensions.Http.Resilience (1)
Internal\RequestMessageSnapshot.cs (1)
37Version = _version!
Microsoft.Extensions.Http.Resilience.Tests (1)
Resilience\RequestMessageSnapshotTests.cs (1)
59Version = new Version(1, 1),
Negotiate.Client (3)
Controllers\AuthTestController.cs (3)
117result = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "auth/Unrestricted") { Version = GetProtocolVersion(protocol2) }); 150result = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "auth/Unrestricted") { Version = GetProtocolVersion(protocol2) }); 183result = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "auth/Authorized") { Version = GetProtocolVersion(protocol2) });
ServerComparison.FunctionalTests (4)
ResponseTests.cs (4)
131Version = new Version(1, 1) 176Version = new Version(1, 0) 201Version = new Version(1, 1) 226Version = new Version(1, 1)
System.Net.Http (2)
System\Net\Http\HttpClient.cs (1)
821new HttpRequestMessage(method, uri) { Version = _defaultRequestVersion, VersionPolicy = _defaultVersionPolicy };
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
546request.Version = HttpVersion.Version11;
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1225_sendRequestMessage.Version = ProtocolVersion;
System.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
87request = new HttpRequestMessage(HttpMethod.Connect, uri) { Version = HttpVersion.Version20 }; 92request = new HttpRequestMessage(HttpMethod.Get, uri) { Version = HttpVersion.Version11 };
33 references to Version
Microsoft.AspNetCore.TestHost (3)
ClientHandler.cs (3)
114req.Protocol = HttpProtocol.GetHttpProtocol(request.Version); 128if (!contentLength.HasValue && request.Version == HttpVersion.Version11) 215response.Version = request.Version;
Microsoft.Extensions.Http.Resilience (1)
Internal\RequestMessageSnapshot.cs (1)
82_version = request.Version;
Microsoft.Extensions.Http.Resilience.Tests (2)
Resilience\RequestMessageSnapshotTests.cs (2)
82Assert.Equal(initialRequest.Version, cloned.Version);
System.Net.Http (25)
System\Net\Http\HttpRequestMessage.cs (1)
48/// Gets or sets the policy determining how <see cref="Version" /> is interpreted and how is the final HTTP version negotiated with the server.
System\Net\Http\HttpTelemetry.cs (2)
62(byte)request.Version.Major, 63(byte)request.Version.Minor,
System\Net\Http\HttpVersionPolicy.cs (2)
16/// as well as a secure connection is being requested, the result is the <see cref="HttpRequestMessage.Version" />. 29/// Otherwise, downgrades to the <see cref="HttpRequestMessage.Version" />.
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (8)
420(request.Version.Major >= 3 || (request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher && IsSecure)) && 446if (request.Version.Major >= 3 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower) 453(request.Version.Major >= 2 || (request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher && IsSecure)) && 483if (request.Version.Major >= 2 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower) 537throw new HttpRequestException(HttpRequestError.VersionNegotiationError, SR.Format(SR.net_http_requested_version_server_refused, request.Version, request.VersionPolicy), e); 725if (request.Version.Major >= 2 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower) 730if (request.Version.Major >= 2 || request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher) 847HttpRequestException ex = new(HttpRequestError.VersionNegotiationError, SR.Format(SR.net_http_requested_version_cannot_establish, request.Version, request.VersionPolicy, desiredVersion), inner);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
614if (request.Version.Major >= 3 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (4)
341Debug.Assert(request.Version.Major >= 0 && request.Version.Minor >= 0); // guaranteed by Version class 342bool isHttp10 = request.Version.Minor == 0 && request.Version.Major == 1;
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (7)
583if (request.Version.Major >= 2) 633if (request.Version != HttpVersion.Version10 && request.Version != HttpVersion.Version11 && request.Version != HttpVersion.Version20 && request.Version != HttpVersion.Version30) 657if (request.Version.Minor == 0 && request.Version.Major == 1 && request.HasHeaders)
System.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
386if (request.Version == HttpVersion.Version11) 395else if (request.Version == HttpVersion.Version20)