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 |