System.Net.HttpWebRequest.ProtocolVersion Property

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

Syntax

public Version ProtocolVersion { get; set; }

Value

A Version that represents the HTTP version to use for the request. The default is HttpVersion.Version11.

Exceptions

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

Remarks

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

Note:

To set the HTTP version of the current request, use the HttpVersion.Version10 and HttpVersion.Version11 fields of the System.Net.HttpVersion class.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0