title: Unexpected HTML Response while Attempting to Post a request to wcf REST service
body: <p>Can some one tell me how to post request to a wcf rest service? my code is below</p>
  
  <pre><code>TResponse Post&lt;TRequest, TResponse&gt;(string uri, TRequset input){
    HttpClient client = new HttpClient();
    HttpContent content = new ObjectContent&lt;TRequest&gt;(input, new XmlMediaTypeFormatter());
    HttpResponseMessage message = client.PostAsync(uri, content).Result;
    return message.Content.ReadAsAsync&lt;TResponse&gt;().Result;
  }
  </code></pre>
  
  <p>but it gives following exception</p>
  
  <pre><code>System.InvalidOperationException was unhandled by user code
  HResult=-2146233079
  Message=No MediaTypeFormatter is available to read an object of type 'String' from content with media type 'text/html'.
  Source=System.Net.Http.Formatting
  </code></pre>
  
  <p>and the value of message variable is</p>
  
  <pre><code>message {StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
  {
  Connection: Close
  Cache-Control: private
  Date: Wed, 19 Dec 2012 14:36:32 GMT
  Server: ASP.NET
  Server: Development
  Server: Server/10.0.0.0
  X-AspNet-Version: 4.0.30319
  Content-Length: 1766
  Content-Type: text/html
  }}  System.Net.Http.HttpResponseMessage
  </code></pre>
  
  <p>i know wcf rest is deprecated. But can some one pls tell me how to implement this?
  thx</p>