title: HttpPostAsync not returning any result but inserting entity correctly
body: <p>I have a generic <code>PostAsync</code> method and then I have my <code>AddCart</code> method to insert my <code>CrCart</code> entity on my api. The thing is, I want to return the result but it will stop and not return anything even though it is inserting on the api correctly.</p>
  <p>Here is my <code>PostAsync</code> method</p>
  <pre><code> // Generic Post Method
          public async Task&lt;T&gt; HttpPostAsync&lt;T&gt;(string url, string token, T data)
          {
              T result = default(T); // résultat de type générique
  
              try
              {
                  string json = JsonConvert.SerializeObject(data);
                  StringContent content = new StringContent(json, Encoding.UTF8, &quot;application/json&quot;);
  
                  httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(&quot;Bearer&quot;, token);
                  var response = await httpClient.PostAsync(new Uri(url), content);
  
                  if (response.IsSuccessStatusCode)
                  {
                      var jsonResponse = await response.Content.ReadAsStringAsync();
                      result = JsonConvert.DeserializeObject&lt;T&gt;(jsonResponse);
                  }
                  else
                  {
                      throw new Exception(((int)response.StatusCode).ToString() + &quot; - &quot; + response.ReasonPhrase);
                  }
                  return result;
              }
              catch (Exception ex)
              {
                  OnError(ex.ToString());
                  return result;
              }
          }
  </code></pre>
  <p>And here is my <code>AddCart</code> method</p>
  <pre><code>public async Task&lt;CrCart&gt; AddCart(string url, string token, CrCart data)
          {
  
              var cart = await _apiService.HttpPostAsync(url, token, data);
  
              return cart;
  
          }
  </code></pre>
  <p>This is where I call <code>AddCart</code>. It is called the same.</p>
  <pre><code>        private async void AddCart()
          {
              if (CurrentPropertiesService.GetCart() == &quot;&quot; )
              {
                  _oCart = new CrCart()
                  {
                      IdCustomer = Convert.ToInt32(CurrentPropertiesService.GetCustomer()),
                      IdUser = Convert.ToInt32(CurrentPropertiesService.GetUserId()),
                      Date = DateTime.UtcNow,
                      Status = &quot;Saved&quot;
                  };
  
                  var cart = await _apiService.AddCart(Constants.UrlCart, CurrentPropertiesService.GetToken(), _oCart);
                  CurrentPropertiesService.SaveCart(cart);
              }
              else
              {
                  _oCart.Id = Convert.ToInt32(CurrentPropertiesService.GetCart());
              }
  
          }
  </code></pre>
  <p>Then I call that method on my constructor. And that is all the call stack.</p>
  <pre><code>public ProductDetailPage(CrProduct oProduct, int category)
          {
              InitializeComponent();
              _oProduct = oProduct;
  
              ProductImage.Source = _oProduct.Image;
              txtName.Text = _oProduct.Name;
              txtDescription.Text = _oProduct.Description;
              txtDetails.Text = _oProduct.Stock.ToString();
              txtPrice.Text = string.Format(&quot;{0:N2}€&quot;, _oProduct.Price.ToString());
              AddCart();
          }
  </code></pre>
  <p>When I try to debug it stops as I said in this line, inserts correctly and doesn't give any errors but doesn't return response.</p>
  <pre><code>var response = await httpClient.PostAsync(new Uri(url), content);
  </code></pre>
  <p>I tried calling it on the OnAppearing() method instead of the constructor and making it async to see if that made any difference but doesn't work either.</p>
  <p>Please help because I don't know what is the issue here. Thanks.</p>