title: C# HttpListener. Sending EMPTY response (without any artefacts)
body: <p>I am using C# HttpListener class to realize some server. And here is the problem. I just want to send to client an empty response to the request like</p>
  
  <pre><code>HTTP/1.1 200 OK
  </code></pre>
  
  <p>or</p>
  
  <pre><code>HTTP/1.1 400 Bad Request
  </code></pre>
  
  <p>without any additional text. So I set status code and status description and don't write any bytes to response OutputStream - I just don't need them. Then close the response to initiate sending bytes to the client with response.Close() method. And what I get on the client side shown by Fiddler is </p>
  
  <pre><code>HTTP/1.1 200 OK
  
  Transfer-Encoding: chunked
  
  Server: Microsoft-HTTPAPI/2.0
  
  Date: Sun, 25 Oct 2015 10:42:12 GMT
  
  
  0
  </code></pre>
  
  <p>There is a workaround for Server and Date fields -
  <a href="https://stackoverflow.com/questions/427326/httplistener-server-header-c-sharp">HttpListener Server Header c#</a>.</p>
  
  <p>But how to remove these "Transfer-Encoding: chunked" artefact and "0" body from this response?!</p>
  
  <p>Thanks to all in advance!</p>
  
  <p>The code:</p>
  
  <pre><code>private void ProcessContext(HttpListenerContext aContext)
      {
          HttpListenerResponse response = aContext.Response;
  
          response.StatusCode = (int)HttpStatusCode.OK;
          response.StatusDescription = "OK";
          response.Close();
  
  }
  </code></pre>