AtomPubClient.RetrieveFeedAsync | retrieveFeedAsync method

Applies to Windows and Windows Phone

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.

Syntax


atomPubClient.retrieveFeedAsync(uri).done( /* Your success and error handlers */ );

Parameters

uri

Type: Windows.Foundation.Uri [JavaScript] | System.Uri [.NET] | Windows::Foundation::Uri [C++]

The URI from which the feed is downloaded.

Return value

Type: IAsyncOperationWithProgress<SyndicationFeed, RetrievalProgress>

Contains the results of the operation.

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>";
        }
    }

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.AtomPub
Windows::Web::AtomPub [C++]

Metadata

Windows.winmd

See also

Quickstart: Managing Feed Entries
AtomPub sample
AtomPubClient

 

 

Show:
© 2014 Microsoft. All rights reserved.