title: StringContent Vs FormUrlEncodedContent
body: <p>I have a URL I want to post a body with parameters to such in the form of data=&quot;blahblahblah&quot;.  However, my &quot;blahblahblah&quot; in this case is a full fledged XML, I simple it down to something like below:</p>
  <pre><code>      &lt;Parent id=&quot;1&quot;&gt;
           &lt;Child id=&quot;1&quot;/&gt;
        &lt;/Parent&gt;
  </code></pre>
  <p>I can get this to work fine with HTTPClient FormUrlEncodedContent using the following approach.</p>
  <pre><code>        var values = new List&lt;KeyValuePair&lt;string, string&gt;&gt;();
          values.Add(new KeyValuePair&lt;string, string&gt;(&quot;data&quot;, XMLBody));
          var content = new FormUrlEncodedContent(values);
          HttpResponseMessage sResponse = await sClient.PostAsync(action.URL, content).ConfigureAwait(false);
  </code></pre>
  <p>Now I want to get this to work with StringContent.   <strong>To basically sending xml as part of a parameter value, and that xml contains the &quot;=&quot;</strong> .  The code below doesn't work, as in I can post it but the server isn't recognize the xml data.  Am I doing something wrong here?</p>
  <pre><code>StringContent content = new StringContent(HttpUtility.UrlEncode(action.Body), Encoding.UTF8, &quot;application/x-www-form-urlencoded&quot;);
  HttpResponseMessage sResponse = await sClient.PostAsync(action.URL, content ).ConfigureAwait(false);
  </code></pre>