title: PostAsJsonAsync returning null
body: <p>I am currently posting a json string to an API to receive an object containing various values.</p>
  
  <p>This is the json string i am posting:</p>
  
  <pre><code>{"SomeProperty":1,"DimensionOne":4,"DimensionTwo":6,"IdNumber":0}
  </code></pre>
  
  <p>Now I don't have issues with the Json string itself because I've tested this string in Fiddler going to the api, and it works perfectly fine, returning all the values I need.</p>
  
  <p>The only difference between what I am doing and what Fiddler is doing is that I am going from the script to a WebService that posts to the API.</p>
  
  <p>Here is the code I am using for the WebService:</p>
  
  <pre><code>[WebService(Namespace = "http://tempuri.org/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [System.ComponentModel.ToolboxItem(false)]
  [ScriptService]
  public class WebService1 : System.Web.Services.WebService
  {
      [WebMethod]
      [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
      public ObjectType Relay(string json)
      {
          const string url = "https://api.com";
          var client = new HttpClient {BaseAddress = new Uri(url)};
  
          client.DefaultRequestHeaders.Clear();
          client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
  
          var response = client.PostAsJsonAsync("api/v1/GetObject", json).Result;
  
          if (response.IsSuccessStatusCode)
          {
              var objectRequest = Task.FromResult(response.Content.ReadAsStringAsync());
              return JsonConvert.DeserializeObject&lt;ObjectType&gt;(objectRequest.Result.Result);
          }
  
          return null;
      }
  }
  </code></pre>
  
  <p>So far it has only returned null (obviously because response.IsSuccessStatusCode is not TRUE)</p>
  
  <p>But when I comment out the if brackets and remove the return null, it gives me an empty object when I should be receiving data. All the inputs are correct.</p>
  
  <p>I'm wondering if I should be using a method other than PostAsJsonAsync, or if there is anything else I should be doing to the json string or json header.</p>
  
  <p>Again, the json string is in correct format as it worked with Fiddler and has previously worked when going directly from the website to the API (without a WebService).</p>
  
  <p>I'd appreciate any suggestions. Thanks in advance.</p>