title: Why is the entire HttpResponseMessage serialized?
body: <p>Why does this Web API implementation</p>
  
  <pre><code>[HttpGet("hello")]
  public HttpResponseMessage Hello()
  {
      var res = new HttpResponseMessage(HttpStatusCode.OK);
      res.Content = new StringContent("hello", Encoding.UTF8, "text/plain");
      return res;
  }
  </code></pre>
  
  <p>return</p>
  
  <pre><code>{
    "Version":{
      "Major":1,
      "Minor":1,
      "Build":-1,
      "Revision":-1,
      "MajorRevision":-1,
      "MinorRevision":-1
    },
    "Content":{
      "Headers":[{
        "Key":"Content-Type",
        "Value":["text/plain; charset=utf-8"]
      }]
    },
    "StatusCode":200,
    "ReasonPhrase":"OK",
    "Headers":[],
    "RequestMessage":null,
    "IsSuccessStatusCode":true
  }
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>hello
  </code></pre>
  
  <p>?</p>
  
  <p>How can I make the Web API return an HTTP response like below?</p>
  
  <pre><code>200 OK
  Content-Type: text/plain
  
  hello
  </code></pre>
  
  <p>What I want to do finally is return JSON and other formats with various status codes, so the following code wouldn't help me as an answer.</p>
  
  <pre><code>[HttpGet("hello")]
  public string Hello()
  {
      return "hello";
  }
  </code></pre>
  
  <p>(I'm new to ASP.NET and other Microsoft technologies.)</p>