title: HTTPClient for calling REST service is not working
body: <p>I am trying to consume REST service which returns me the data in JSON format. And I am using simple logic. But code get stuck on the line . I have check this code from emulator as well as from Device. 
  <code>var response = await httpClient.SendAsync(request);</code></p>
  
  <p>Here is my code</p>
  
  <pre><code>public async Task&lt;string&gt; GetMyData(string urlToCall)
          {    
              using (HttpClient httpClient = new HttpClient())
              {                    
                  HttpRequestMessage request = new HttpRequestMessage(System.Net.Http.HttpMethod.Get, urlToCall);
                  var response = await httpClient.SendAsync(request);
                  var responseString = await response.Content.ReadAsStringAsync();
                  return responseString;
              }
          }
  </code></pre>
  
  <p>and calling is like,</p>
  
  <pre><code>string result = GetMyData(url).Result;
  </code></pre>
  
  <p>Is I am missing something? I want to get the data synchronously, instead of WebClient I choose HTTPClient for synchronous data call.</p>
  
  <p>Can anyone please suggest me any solution.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Thanks @Mike Richards for pointing me in right direction
  I want to achieve the flow like below,</p>
  
  <p>Call from Main.xaml.cs for aunticateuser() -> calling aunticateuser() methode in Process Class-> once response get from service return control back to Main.xaml.cs -> naviagate to another page i.e. Dashboard.xaml</p>
  
  <p>But in real case its working like, call going to aunticateuser() methode in Process Class and where its send request to service and coming back to Main.xaml.cs but not waiting there to listen the response so how I will decide is this user is valid or not until I get the response?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>    private void ApplicationBarDone_Click(object sender, EventArgs e)
              {
                  bool isValid = checkForValidation();
  
                  if (isValid)
                  {
                      string url = txtUrl.Text.ToString().TrimStart(' ').TrimEnd(' ');
                      string login = txtLogin.Text.ToString().TrimStart(' ').TrimEnd(' ');
                      string clientKey = txtSystemKey.Text.ToString().TrimStart(' ').TrimEnd(' ');
                      string psw = txtPassword.Text.ToString().TrimStart(' ').TrimEnd(' ');
  
                      RestfulWebServiceUserDAO userDAO = new RestfulWebServiceUserDAO();
                      userDAO.authenticateUser(login, psw, clientKey, url);
                     //navigate to another page  from here ??
                  }
              }
  </code></pre>
  
  <p>In RestfulWebServiceUserDAO class authenticateUser() methode present</p>
  
  <pre><code>public async override void authenticateUser(string login, string password, string clientkey, string systemurl)
          {
  
              string url = systemurl + "/rest/user?login=" + login + "&amp;password=" + password + "&amp;clientkey=" + clientkey + "&amp;languageId=" + 1;  
  
              string result = await GetMyData(url);
             //or shall I navigate from here?? this is not allowed :|
          }
  </code></pre>
  
  <p>GetMyData() methode same in RestfulWebServiceUserDAO class that what I have mark above.</p>