ASP.NET Core HTTPRequestMessage returns strange JSON message
<p>I am currently working with ASP.NET Core RC2 and I am running into some strange results.
So I have an MVC controller with the following function:</p>

<pre class="lang-cs prettyprint-override"><code>public HttpResponseMessage Tunnel() {
    var message = new HttpResponseMessage(HttpStatusCode.OK);
    message.Content = new StringContent("blablabla", Encoding.UTF8);
    message.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/plain");
    message.Headers.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue {
        NoCache = true
    };

    return message;
}
</code></pre>

<p>If I call this with postman with an Accept header set to text plain I get this response:</p>

<pre class="lang-json prettyprint-override"><code>{
  "Version": {
    "Major": 1,
    "Minor": 1,
    "Build": -1,
    "Revision": -1,
    "MajorRevision": -1,
    "MinorRevision": -1
  },
  "Content": {
    "Headers": [
      {
        "Key": "Content-Type",
        "Value": [
          "text/plain"
        ]
      }
    ]
  },
  "StatusCode": 200,
  "ReasonPhrase": "OK",
  "Headers": [
    {
      "Key": "Cache-Control",
      "Value": [
        "no-cache"
      ]
    }
  ],
  "RequestMessage": null,
  "IsSuccessStatusCode": true
}
</code></pre>

<p>I really do not understand how this is the generated reponse to the above controller. It is basically a JSON serialization of the entire message itself and does in no way contain the "blablabla" I intended to send.</p>

<p>The only way I have gotten the desired result is by making my controller function return <code>string</code> instead of <code>HttpResponse</code>, but that way I am unable to set headers like <code>CacheControl</code></p>

<p>So my question is: why do I get this strange response? It seems like very weird behaviour to me</p>