Share via


SyndicationClient Class

Definition

Implements the ISyndicationClient interface which retrieves feeds from a URI asynchronously.

[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Syndication.ISyndicationClientFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SyndicationClient : ISyndicationClient
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Syndication.ISyndicationClientFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class SyndicationClient : ISyndicationClient
Inheritance
Object SyndicationClient
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The following code demonstrates how to retrieve a feed using RetrieveFeedAsync.

using Windows.Foundation;
using Windows.Web.Syndication;

async Task GetFeedAsync(string feedUri)
{
    var uri = new Uri(feedUri);
    var client = new SyndicationClient(){ BypassCacheOnRetrieve = true };
    currentFeed = await client.RetrieveFeedAsync(uri);
}

For additional examples that demonstrate how this class is used to retrieve syndicated content from the web, see Quickstart: Accessing a web feed.

Constructors

SyndicationClient()

Creates a new SyndicationClient object.

SyndicationClient(PasswordCredential)

Creates a new SyndicationClient object with authentication credentials.

Properties

BypassCacheOnRetrieve

Gets or sets a Boolean value that specifies whether to bypass the cache when retrieving the feed.

MaxResponseBufferSize

Gets or sets the maximum number of bytes to buffer when receiving a response from a server.

ProxyCredential

Gets or sets the credentials to use when making requests via a proxy.

ServerCredential

Gets or sets the credentials to use when making requests to the server.

Timeout

Gets or sets the maximum amount of time, in milliseconds, to wait for any of the asynchronous operations to complete. If the operation is not complete within this amount of time, it will fail with a status code indicating that it timed out.

Methods

RetrieveFeedAsync(Uri)

Starts an asynchronous operation to download the syndication feed from the given URI. This method instantiates a SyndicationFeed object from the feed string, which can be in one of the formats specified in SyndicationFormat.

SetRequestHeader(String, String)

Sets an HTTP header for the request. This method can be called multiple times to set multiple headers. When the same header is set multiple times, the values will be concatenated and separated by ",".

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also