HttpBaseProtocolFilter.MaxVersion HttpBaseProtocolFilter.MaxVersion HttpBaseProtocolFilter.MaxVersion HttpBaseProtocolFilter.MaxVersion HttpBaseProtocolFilter.MaxVersion Property

Definition

Gets or sets the version of the HTTP protocol used.

public : HttpVersion MaxVersion { get; set; }
HttpVersion MaxVersion();

void MaxVersion(HttpVersion maxversion);
public HttpVersion MaxVersion { get; set; }
Public ReadWrite Property MaxVersion As HttpVersion
var httpVersion = httpBaseProtocolFilter.maxVersion;
httpBaseProtocolFilter.maxVersion = httpVersion;

Property Value

An enumeration value that specifies the version of HTTP used.

Examples

The following code shows how to create an HttpClient that uses HTTP 1.1 rather than the default HTTP 2.0.

HttpBaseProtocolFilter filter = new HttpBaseProtocolFilter(); 

filter.MaxVersion = HttpVersion.Http11;

HttpClient client = new HttpClient(filter);

Remarks

By default, when a new request is started using Windows.Web.Http.HttpClient, it uses HTTP 2.0. To create an instance of HttpClient that uses HTTP 1.1 instead, set this property to HttpVersion.Http11 on a filter, and then create a new instance of HttpClient, passing the filter as an argument to the HttpClient constructor.