HttpBaseProtocolFilter HttpBaseProtocolFilter HttpBaseProtocolFilter HttpBaseProtocolFilter HttpBaseProtocolFilter Class


The base protocol filter for an HttpClient instance.

public : sealed class HttpBaseProtocolFilter : IClosable, IHttpFilter
struct winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter : IClosable, IHttpFilter
public sealed class HttpBaseProtocolFilter : IDisposable, IHttpFilter
Public NotInheritable Class HttpBaseProtocolFilter Implements IDisposable, IHttpFilter
var httpBaseProtocolFilter = new httpBaseProtocolFilter();

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The HttpBaseProtocolFilter class provides the base filter or handler that is used by an HttpClient instance. If no additional filters are added to the HttpClient instance, then the HttpBaseProtocolFilter object will be the only filter.

The HttpBaseProtocolFilter class provides a set of properties for toggling various low-level HTTP stack behaviors.

Additional filters based on the IHttpFilter interface can be added to the filter chain applied to an HttpClient instance that can further handle or process the results from the HttpBaseProtocolFilter object.

The HttpBaseProtocolFilter object throws exceptions when sending HTTP requests or receiving response and network failures occur (loss of connectivity in airplane mode, for example). Developers using HttpClient in apps may prefer to add a filter to catch these exceptions and convert them to HTTP response codes instead.


HttpBaseProtocolFilter() HttpBaseProtocolFilter() HttpBaseProtocolFilter() HttpBaseProtocolFilter() HttpBaseProtocolFilter()

Initializes a new instance of the HttpBaseProtocolFilter class.


AllowAutoRedirect AllowAutoRedirect AllowAutoRedirect AllowAutoRedirect AllowAutoRedirect

Get or set a value that indicates whether the HttpBaseProtocolFilter should follow redirection responses.

AllowUI AllowUI AllowUI AllowUI AllowUI

Get or set a value that indicates whether the HttpBaseProtocolFilter can prompt for user credentials when requested by the server.

AutomaticDecompression AutomaticDecompression AutomaticDecompression AutomaticDecompression AutomaticDecompression

Gets or sets a value that indicates whether the HttpBaseProtocolFilter can automatically decompress the HTTP content response.

CacheControl CacheControl CacheControl CacheControl CacheControl

Get or set the read and write cache control behavior to be used on the HttpBaseProtocolFilter object.

ClientCertificate ClientCertificate ClientCertificate ClientCertificate ClientCertificate

Get or set the client SSL certificate that will be sent to the server if the server requests a client certificate.

CookieManager CookieManager CookieManager CookieManager CookieManager

Get the HttpCookieManager with the cookies associated with an app.

CookieUsageBehavior CookieUsageBehavior CookieUsageBehavior CookieUsageBehavior CookieUsageBehavior

Gets or sets the cookie usage behavior. By default, cookies are handled automatically.

IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors

Get a vector of SSL server certificate errors that the app might subsequently choose to ignore.

MaxConnectionsPerServer MaxConnectionsPerServer MaxConnectionsPerServer MaxConnectionsPerServer MaxConnectionsPerServer

Get or set the maximum number of TCP connections allowed per HTTP server by the HttpBaseProtocolFilter object.

MaxVersion MaxVersion MaxVersion MaxVersion MaxVersion

Gets or sets the version of the HTTP protocol used.

ProxyCredential ProxyCredential ProxyCredential ProxyCredential ProxyCredential

Get or set the credentials to be used to negotiate with an HTTP proxy.

ServerCredential ServerCredential ServerCredential ServerCredential ServerCredential

Get or set the credentials to be used to authenticate with an HTTP server.

UseProxy UseProxy UseProxy UseProxy UseProxy

Get or set a value that indicates whether the HttpBaseProtocolFilter can use a proxy for sending HTTP requests.

User User User User User

Gets the User associated with the HttpBaseProtocolFilter.


ClearAuthenticationCache() ClearAuthenticationCache() ClearAuthenticationCache() ClearAuthenticationCache() ClearAuthenticationCache()

Clears authentication credentials currently cached on the device.

Close() Close() Close() Close() Close()

Closes the HttpBaseProtocolFilter instance and releases allocated resources.

CreateForUser(User) CreateForUser(User) CreateForUser(User) CreateForUser(User) CreateForUser(User)

Creates a new HttpBaseProtocolFilter for a specific User.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

SendRequestAsync(HttpRequestMessage) SendRequestAsync(HttpRequestMessage) SendRequestAsync(HttpRequestMessage) SendRequestAsync(HttpRequestMessage) SendRequestAsync(HttpRequestMessage)

Send an HTTP request using the HttpBaseProtocolFilter as an asynchronous operation.


ServerCustomValidationRequested ServerCustomValidationRequested ServerCustomValidationRequested ServerCustomValidationRequested ServerCustomValidationRequested

This event is raised when the SSL/TLS connection is being established with the server. You should implement an event handler for this event if you need to perform extra validation (in addition to the OS default) of the server SSL certificate.

See also