Share via


AtomPubClient.RetrieveFeedAsync(Uri) Method

Definition

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.

public:
 virtual IAsyncOperationWithProgress<SyndicationFeed ^, RetrievalProgress> ^ RetrieveFeedAsync(Uri ^ uri) = RetrieveFeedAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<SyndicationFeed, RetrievalProgress> RetrieveFeedAsync(Uri const& uri);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<SyndicationFeed,RetrievalProgress> RetrieveFeedAsync(System.Uri uri);
function retrieveFeedAsync(uri)
Public Function RetrieveFeedAsync (uri As Uri) As IAsyncOperationWithProgress(Of SyndicationFeed, RetrievalProgress)

Parameters

uri
Uri Uri

The URI from which the feed is downloaded.

Returns

Contains the results of the operation.

Implements

M:Windows.Web.Syndication.ISyndicationClient.RetrieveFeedAsync(Windows.Foundation.Uri) M:Windows.Web.Syndication.ISyndicationClient.RetrieveFeedAsync(System.Uri)
Attributes

Examples

The following code demonstrates how a feed is retrieved at a specific service address using AtomPubClient. For additional examples of how AtomPub can be used to manage feed content, download the AtomPub sample.

function retieveFeed() {
    try {
        // Refresh client in case server url or credential have changed.
        createClient();

        // Note that this feed is public by default and will not require authentication.
        // We will only get back a limited use feed, without information about editing.
        var resourceUri = new Windows.Foundation.Uri(document.getElementById("serviceAddressField").value.trim() + defaultFeedUri);

        outputField.innerHTML = "Fetching resource: " + resourceUri.absoluteUri + "/br";
        client.retrieveFeedAsync(resourceUri).done(function (feed) {
            currentFeed = feed;
            currentItemIndex = 0;

            outputField.innerHTML += "Complete</br>";
            displayCurrentItem();
        }, onError);
    }
    catch (ex) {
        outputField.innerHTML += "Exception:" + ex + "</br>";
    }
}

Applies to

See also