title: HTTPClient returns 400 Bad Request but Postman returns 201 in C#
body: <p>I have the following code for a post request</p>
  <pre><code>    [TestMethod]
      public async Task&lt;Tuple&lt;int, string&gt;&gt; PostRequestAdditionalAttributeValid0000()
      {
          string locationPath = solutionDirectory.ToString();
          var jsonText = File.ReadAllText(locationPath + @&quot;\TestJsons\testdata.json&quot;);
  
          using (var client = new HttpClient())
          {
              var content = new StringContent(json, Encoding.UTF8, &quot;application/json&quot;);
              
              //Add client header
              client.DefaultRequestHeaders.Add(&quot;client_uuid&quot;, &quot;2fd77dd8-ed76-4bba-b0e1-5cda454c8d6e&quot;);
  
              var result = await client.PostAsync(urlPost, content);
  
              int StatusNumber = (int)result.StatusCode;
              string resultContent = await result.Content.ReadAsStringAsync();
  
              return new Tuple&lt;int, string&gt;(StatusNumber, resultContent);
          }
      }
  </code></pre>
  <p>and in Postman it returns a 201 but HTTPClient returns a 400 response (Bad Request). I have no idea why.</p>
  <p>My json is as follows</p>
  <pre><code>{       
      &quot;audit_date&quot;: &quot;2020-05-13T11:27:10.3187798Z&quot;,
      &quot;client_uuid&quot;: &quot;2fd77dd8-ed76-4bba-b0e1-5cda454c8d6e&quot;,
      &quot;audit_entry&quot;: {
          &quot;where_uri&quot;: &quot;test.com/apps/171f0841-825b-4964-8f8c-0869650f14a6&quot;,
          &quot;why_uri&quot;: &quot;test.com/reference/reasons_for_change/61acc173-7168-4ae5-9f04-afa228941f8b&quot;,
          &quot;who_uri&quot;: &quot;test.com/users/4977dae1-a307-425f-980c-53413fef1b0f&quot;,
          &quot;when_audited&quot;: &quot;2018-11-13T20:20:39+00:00&quot;,
          &quot;what_uri&quot;: &quot;test.com/tests/1bc67a71-8549-4ab8-9dd9-e44238198860&quot;,
          &quot;what_changed&quot;: [
              {
                  &quot;attribute_name&quot;: &quot;birth_year&quot;,
                  &quot;attribute_value&quot;: &quot;1969&quot;,
                  &quot;attribute_change&quot;: null
              },
              {
                  &quot;attribute_name&quot;: &quot;subject_reference&quot;,
                  &quot;attribute_value&quot;: &quot;TEST-WOO3444&quot;,
                  &quot;attribute_change&quot;: null
              }
          ]
      }    
  }
  </code></pre>
  <p>Any help much appreciated. I've googled and read other similar questions, even tried solutions from other stackoverflow posts but none seem to work.</p>
  <p>This is the error I am getting alongside the 400 Bad request</p>
  <p>Object reference not set to an instance of an object.</p>
  <p>After stepping through this line of code</p>
  <pre><code>var result = await client.PostAsync(urlPost, content);
  </code></pre>