title: Posting to a Web API from a Xamarin Android application
body: <p>I am building a Xamarin Android app that connects to a web api. I want to post a complex object to the api and the receive an object again. It works when I post an object and receive a bool value, but not with receiving a complex object. Also it works when I use it in a Windows Mobile app. This method is in a portable library.
  Here is my post method:</p>
  
  <pre><code>public static IResponseObject Post&lt;T, TOut&gt;(string url, T BindingModel)
          {
              IResponseObject result;
  
              using (var client = new HttpClient())
              {
                  var response =
                      client.PostAsJsonAsync(String.Format("{0}{1}", _base, url), BindingModel).Result;
  
                  if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.Created)
                      result = response.Content.ReadAsAsync&lt;SuccessResponseObject&lt;TOut&gt;&gt;().Result;
                  else
                      result = response.Content.ReadAsAsync&lt;BadRequestResponse&gt;().Result;
                  ((ResponseObject)result).Status = response.StatusCode;
  
                  return result; 
              }
          }
  </code></pre>
  
  <p>Should I be doing something different for Android?</p>