Share via


ProtocolVersion Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the version of HTTP to use for the request.

Namespace:  System.Net
Assembly:  System.Http (in System.Http.dll)

Syntax

'Declaration
Public Property ProtocolVersion As Version
public Version ProtocolVersion { get; set; }
public:
property Version^ ProtocolVersion {
    Version^ get ();
    void set (Version^ value);
}
member ProtocolVersion : Version with get, set
function get ProtocolVersion () : Version
function set ProtocolVersion (value : Version)

Property Value

Type: System. . :: . .Version
The HTTP version to use for the request. The default is HttpVersion..::..Version11.

Exceptions

Exception Condition
ArgumentException

The HTTP version is set to a value other than 1.0 or 1.1.

Remarks

The HttpWebRequest class supports only versions 1.0 and 1.1 of HTTP. Setting ProtocolVersion to a different version throws an exception.

.NET Framework Security

See Also

Reference

HttpWebRequest Class

System.Net Namespace