

Name it as ‘Store_JS_Download_Image_Xhr’. Step 1: Open VS 2012 and create a new Windows Store Apps, using JavaScript. It is an image on a shared public DropBox folder (Image is CC licensed). Note: We will use the following file to test the download. You can get the more information about WinJS.xhr from here. responseType: The expected response of the call made.url: This is the mandatory parameter which represents the URL resource.The call made using WinJS.xhr takes several parameters as below: The promise is the abstraction provided over the available asynchronous operations.

The WinJS.xhr wraps call to XMLHttpResponse in a promise. In this sample today, we will see how to make use of WinJS.xhr for downloading image file from a remote URL.

The WinJS.xhr is an important module in WinJS wherein it helps wrap cross-domain calls and provides an easy mechanism to work with external web contents using HTTP operations like GET/POST etc. As we all know the WinJS library helps us build Windows 8 Store Apps in HTML5 and JavaScript.
