title: How to send XML content with HttpClient.PostAsync?
body: <p>I am trying to fulfill <a href="http://confluence.jetbrains.com/display/YTD5/Create+New+Work+Item" rel="noreferrer">this rest api</a>:</p>
  
  <pre><code>public async Task&lt;bool&gt; AddTimetracking(Issue issue, int spentTime)
  {
      // POST /rest/issue/{issue}/timetracking/workitem
      var workItem = new WorkItem(spentTime, DateTime.Now);
      var httpContent = new StringContent(workItem.XDocument.ToString());
      var requestUri = string.Format("{0}{1}issue/{2}/timetracking/workitem", url, YoutrackRestUrl, issue.Id);
      var respone = await httpClient.PostAsync(requestUri, httpContent);
      if (!respone.IsSuccessStatusCode)
      {
          throw new InvalidUriException(string.Format("Invalid uri: {0}", requestUri));
      }
  
      return respone.IsSuccessStatusCode;
  }
  </code></pre>
  
  <p><code>workItem.XDocument</code> contains the following elements:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;workItem&gt;
    &lt;date&gt;1408566000&lt;/date&gt;
    &lt;duration&gt;40&lt;/duration&gt;
    &lt;desciption&gt;test&lt;/desciption&gt;
  &lt;/workItem&gt;
  </code></pre>
  
  <p>I am getting an error from the API: <code>Unsupported Media Type</code></p>
  
  <p>I really have no idea how to resolve this, help is greatly appreciated. How do I <em>marshall</em> an XML file via a HTTP POST URI, using <code>HttpClient</code>? </p>