title: xamarin iOS using shared project with HttpClient not working
body: <p>I have a Xamarin android project set up using a shared project for all of my network services that works great.  In that shared project I have a class with a method that is calling a REST endpoint via <code>HttpClient.PostAsync()</code>.  I am now working on the iOS version and thought this would be pretty painless to just use the same classes/methods that I've already fleshed out for android but for some reason, iOS is not working.</p>
  
  <p>I'm not getting any exceptions being thrown, just the call to <code>PostAsync()</code> seems to die and not do anything that I can tell.  I have also tried a <code>GetAsync()</code> call with the same result...nothing happens.</p>
  
  <p>Here is some example code:</p>
  
  <pre><code>public class UserService
  {
      public async Task&lt;UserModel&gt; LoginUser(UserModel userModel)
      {
          var url = new Uri(Constants.BaseUrl + "v2api/LoginUser");
          try
          {
              using (var client = new HttpClient())
              {
                  client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                  string userModelString = JsonConvert.SerializeObject(userModel);
                  var response = await client.PostAsync(url, new StringContent(userModelString, Encoding.Default, "application/json"));
                  if (response.IsSuccessStatusCode)
                  {
                      userModel = JsonConvert.DeserializeObject&lt;UserModel&gt;(await response.Content.ReadAsStringAsync());
                  }
              }
          }
          catch (Exception e)
          {
              string exceptionString = e.ToString();
          }
          return userModel;
      }
  }
  </code></pre>
  
  <p>I've put breakpoints all over this and it gets to the: v<code>ar response = await</code> line, but that's it.  I never get anything returned.  As mentioned above, this works great with the android project, it's only iOS that's not working.  I'm sure I'm overlooking something really simple, I just don't know what it could be.</p>
  
  <p>I have tried adding this to my <code>info.plist</code> file, but it didn't help:</p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;NSExceptionDomains&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;mysite.com&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
              &lt;true /&gt;
              &lt;key&gt;NSExceptionRequiresForwardSecrecy&lt;/key&gt;
              &lt;false /&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>any suggestions of where to look next?</p>
  
  <p>tia</p>