async private void ButtonGetDateClicked(object sender, EventArgs a)
{
- this.RemoteDate.Buffer.Text = await view.getCurrentDate();
+ string currentDate = await view.getCurrentDate();
+ if (currentDate != null)
+ {
+ this.RemoteDate.Buffer.Text = currentDate;
+ }
}
}
}
async public Task<TResult> callRemoteService<TResult>(string uri, string method)
{
- TResult result = default(TResult);
- POST postData = new POST();
+ var postData = new POST();
postData.Id = "2114567586433855105";
postData.JSONrpc = "2.0";
postData.Method = method;
HttpResponseMessage response = await this.issueCall(uri, content);
+ TResult result = default(TResult);
+
if (response.StatusCode == HttpStatusCode.OK) {
Task<byte[]> responseBytes = response.Content.ReadAsByteArrayAsync();
string responseString = System.Text.Encoding.UTF8.GetString(responseBytes.Result);