title: Set request Content-Type on WinRT HttpClient
body: <p>I'm developing a Windows 8.1 Store apps with C# and .NET Framework 4.5.1.</p>
  
  <p>I'm trying to do a POST to a REST API but I get an Unsupported Media Type with this code:</p>
  
  <pre><code>public async Task&lt;HttpResponseMessage&gt; POST(string url, string jsonContent)
  {
      Uri resourceUri;
  
      resourceUri = ValidateUri(url);
  
      HttpClient httpClient = new HttpClient();
      HttpResponseMessage response = new HttpResponseMessage();
  
      HttpRequestHeaderCollection headers = httpClient.DefaultRequestHeaders;
  
      // Try to add user agent to headers.
      if (headers.UserAgent.TryParseAdd(_userAgent))
          headers.UserAgent.ParseAdd(_userAgent);
  
      // Add Content-Type and Content-Length headers
      headers.Accept.Add(new HttpMediaTypeWithQualityHeaderValue("application/json"));
  
      response = await httpClient.PostAsync(resourceUri, new HttpStringContent(jsonContent));
  
      return response;
  }
  </code></pre>
  
  <p>If I change this line:</p>
  
  <pre><code>response = await httpClient.PostAsync(resourceUri, new HttpStringContent(jsonContent));
  </code></pre>
  
  <p>With this one:</p>
  
  <pre><code>response = await httpClient.PostAsync(resourceUri, new HttpStringContent(string.Empty));
  </code></pre>
  
  <p>It works. I don't get 415 status code.</p>
  
  <p><code>jsonContent</code> value is:</p>
  
  <p><code>{"UserName":"My Name","Provider":"Facebook","ExternalAccessToken":"Access token omitted"}</code></p>