Where exactaly is raised the NullReferenceException? Is this at this line :
HttpResponseMessage response = await httpClient.GetAsync("http://melihsimsek.com/server/init.php");
There is something weird in your code:
You have this method :
public void BlankPage() { ... }
and a constructor
public MainPage() { ... }
And in this BlankPage method, you call the InitializeComponent, as if it was a constructor of your page.
All you code to initialize the HttpClient is in there. I may be wrong but in your code you never call BlankPage, so your HttpClient is never instanciated.
Try removing the BlankPage method, and putting the intialization code in the MainPage constructor instead, like this :
public MainPage()
{
this.InitializeComponent();
httpClient = new HttpClient();
// Limit the max buffer size for the response so we don't get overwhelmed
httpClient.MaxResponseContentBufferSize = 256000;
httpClient.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)");
}
--------------
http://www.renauddumont.be