I am working on UWP library(which will be used by UWP application) , where i am trying to make HTTP Request from JavaScript using "Windows.Web" namespace.
Below is the sample i am trying to run:
var uri = new Windows.Foundation.Uri("http://google.com");
var httpClient = new Windows.Web.Http.HttpClient();
httpClient.getStringAsync(uri).done(function () {
// do something with the string content "
Debug.writeln("finished");
}, onError);
function onError(reason) {
// error handling
Debug.writeln( "onError");
}
But this script is not working properly. After making Async call, I am not able to do anything with the response.
Do I need to do something else to make this async call work, such as using "JsSetProjectionEnqueueCallback" ?
But as per the documentation, for UWP apps, its not required to setup "JsSetProjectionEnqueueCallback".
Can someone please help with the sample code as well in C#?
I am working on UWP library(which will be used by UWP application) , where i am trying to make HTTP Request from JavaScript using "Windows.Web" namespace. Below is the sample i am trying to run: var uri = new Windows.Foundation.Uri("http://google.com"); var httpClient = new Windows.Web.Http.HttpClient();
httpClient.getStringAsync(uri).done(function () { // do something with the string content " Debug.writeln("finished"); }, onError); function onError(reason) { // error handling Debug.writeln( "onError"); }
But this script is not working properly. After making Async call, I am not able to do anything with the response. Do I need to do something else to make this async call work, such as using "JsSetProjectionEnqueueCallback" ? But as per the documentation, for UWP apps, its not required to setup "JsSetProjectionEnqueueCallback".
Can someone please help with the sample code as well in C#?