Warning: Cannot modify header information - headers already sent by (output started at /var/www/lalieno.it/index.php:48) in /var/www/lalieno.it/inc/cookie.php on line 3
a cadenza discontinua
Come se fossi
BLOG

[Visual Studio 2013 C# Windows Phone 8.1] - Http request with HttpClient

Below is a small example of how to make a request via Http HttpClient in C #.

// init
var myHttpClient = new HttpClient();

// await request the function must be async
var request = await myHttpClient.GetAsync(new Uri("http://miosito.it/index.php?nocache=" + Guid.NewGuid(), UriKind.RelativeOrAbsolute));
        
// response
var response = await request.Content.ReadAsStringAsync();

Adding nocache = "+ Guid.NewGuid () can disable the cache, which is useful when we have to make a request frequently.


di GuiZ
04/02/2015

Commenta

We'll never share your email with anyone else.