title: Geting Unsupported Media Type calling 3rd party API in .NET Core
body: <p>I am getting Unsupported Media Type.
  I think I am specifying media type as JSON, but still get the same error.</p>
  <p>Here is my code:</p>
  <pre><code>           var request = new HttpRequestMessage(HttpMethod.Post, uri);
             //custom headers
              request.Headers.Add(&quot;Custom-Signature&quot;, msg);
              request.Headers.Add(&quot;Client-Id&quot;, ClientId);
  
              request.Content =
                  new StringContent(JsonSerializer.Serialize(pr), Encoding.UTF8, &quot;application/json&quot;);
              using var httpResponse = await client.SendAsync(request);
  </code></pre>
  <p>When I use Postman everything works.</p>
  <ul>
  <li>I need to send json as <code>Content-Type</code>.</li>
  <li>I also need to add Content-Length.</li>
  <li>Content-Type and Content-Length are mandatory fields.</li>
  </ul>