Skip to content

Commit f24ea46

Browse files
committed
feat: Now HttpClient will try to use HTTP/3.0 or HTTP/2.0 if available
1 parent 7f28a79 commit f24ea46

File tree

4,925 files changed

+19703
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,925 files changed

+19703
-0
lines changed

src/libs/AutoSDK/Sources/Sources.Methods.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ public static string GenerateMethod(
140140
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
141141
method: {GetHttpMethod(endPoint.Settings.TargetFramework, endPoint.HttpMethod)},
142142
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
143+
#if NET6_0_OR_GREATER
144+
{ // Use HTTP/3.0 or HTTP/2.0 if available
145+
// https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-http3#httpclient-settings
146+
" "}
147+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
148+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
149+
#endif
143150
{(endPoint.Authorizations.Any(x => x is
144151
{ Type: SecuritySchemeType.ApiKey, In: ParameterLocation.Header } or
145152
{ Type: SecuritySchemeType.Http } or

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte
5757
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
5858
method: global::System.Net.Http.HttpMethod.Post,
5959
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
60+
#if NET6_0_OR_GREATER
61+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
62+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
63+
#endif
6064
using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
6165
if (requestStartTime != default)
6266
{

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganization
5555
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
5656
method: global::System.Net.Http.HttpMethod.Post,
5757
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
58+
#if NET6_0_OR_GREATER
59+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
60+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
61+
#endif
5862

5963
PrepareRequest(
6064
client: HttpClient,

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizat
6060
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
6161
method: global::System.Net.Http.HttpMethod.Get,
6262
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
63+
#if NET6_0_OR_GREATER
64+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
65+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
66+
#endif
6367

6468
PrepareRequest(
6569
client: HttpClient,

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganiz
5555
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
5656
method: global::System.Net.Http.HttpMethod.Get,
5757
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
58+
#if NET6_0_OR_GREATER
59+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
60+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
61+
#endif
5862

5963
PrepareRequest(
6064
client: HttpClient,

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.Api.V1ConversationalRag.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ partial void ProcessV1ConversationalRagResponseContent(
5757
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
5858
method: global::System.Net.Http.HttpMethod.Post,
5959
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
60+
#if NET6_0_OR_GREATER
61+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
62+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
63+
#endif
6064
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
6165
var __httpRequestContent = new global::System.Net.Http.StringContent(
6266
content: __httpRequestContentBody,

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.ChatClient.V1J2UltraChat.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ partial void ProcessV1J2UltraChatResponseContent(
6565
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
6666
method: global::System.Net.Http.HttpMethod.Post,
6767
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
68+
#if NET6_0_OR_GREATER
69+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
70+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
71+
#endif
6872
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
6973
var __httpRequestContent = new global::System.Net.Http.StringContent(
7074
content: __httpRequestContentBody,

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.CompletionClient.V1J2GrandeComplete.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ partial void ProcessV1J2GrandeCompleteResponseContent(
6565
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
6666
method: global::System.Net.Http.HttpMethod.Post,
6767
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
68+
#if NET6_0_OR_GREATER
69+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
70+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
71+
#endif
6872
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
6973
var __httpRequestContent = new global::System.Net.Http.StringContent(
7074
content: __httpRequestContentBody,

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.CompletionClient.V1J2GrandeCustomModelComplete.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ partial void ProcessV1J2GrandeCustomModelCompleteResponseContent(
7070
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
7171
method: global::System.Net.Http.HttpMethod.Post,
7272
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
73+
#if NET6_0_OR_GREATER
74+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
75+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
76+
#endif
7377
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
7478
var __httpRequestContent = new global::System.Net.Http.StringContent(
7579
content: __httpRequestContentBody,

src/tests/AutoSDK.SnapshotTests/Snapshots/Ai21/NewtonsoftJson/_#G.CompletionClient.V1J2GrandeInstructComplete.g.verified.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ partial void ProcessV1J2GrandeInstructCompleteResponseContent(
6565
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
6666
method: global::System.Net.Http.HttpMethod.Post,
6767
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
68+
#if NET6_0_OR_GREATER
69+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
70+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
71+
#endif
6872
var __httpRequestContentBody = request.ToJson(JsonSerializerOptions);
6973
var __httpRequestContent = new global::System.Net.Http.StringContent(
7074
content: __httpRequestContentBody,

0 commit comments

Comments
 (0)