AtomPubClient.RetrieveFeedAsync(Uri) Method
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.
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
Returns
Contains the results of the operation.
Implements
- 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>";
}
}