HttpBaseProtocolFilter.MaxVersion 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 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.