Share via


HttpBaseProtocolFilter.MaxVersion Property

Definition

Gets or sets the version of the HTTP protocol used.

public:
 property HttpVersion MaxVersion { HttpVersion get(); void set(HttpVersion value); };
HttpVersion MaxVersion();

void MaxVersion(HttpVersion value);
public HttpVersion MaxVersion { get; set; }
var httpVersion = httpBaseProtocolFilter.maxVersion;
httpBaseProtocolFilter.maxVersion = httpVersion;
Public Property MaxVersion As 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.

Applies to