HttpRequestMessage.Version Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the HTTP message version.
public:
property Version ^ Version { Version ^ get(); void set(Version ^ value); };
public Version Version { get; set; }
member this.Version : Version with get, set
Public Property Version As Version
Property Value
The HTTP message version. The default value is 1.1
, unless you're targeting .NET Core 2.1 or 2.2. In that case, the default value is 2.0
.
Remarks
In .NET Core, the default message version differs based on the version you're using. .NET Core 2.1 changed the default value from 1.1
to 2.0
. In .NET Core 3.0, the default value was reverted back to 1.1
.
.NET Framework
The default message version is 1.1
.
.NET Core
The following table lists the default message version based on the version of .NET Core:
.NET Core version | HTTP request version |
---|---|
2.1 2.2 |
2.0 |
Any other .NET Core version | 1.1 |
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應