title: Datatables.net - Invalid Json Response
body: <p>I'm having a hard time using DataTables.net. I did a lot of research and it seems that I'm doing right, I tried different combinations, even the debug option on DataTables, but I think that I'm missing some dumb detail, I keep getting "<em>Invalid Json Response</em>"</p>
  
  <p>Below I put the HTML, Client Side code, Server Side code, Ajax request/responde headers and Json Response. If someone point what I'm missing here I really appreciate.</p>
  
  <p><strong>HTML</strong>:</p>
  
  <pre><code>&lt;table id="tableQuery" class="table table-striped table-bordered"&gt;            
      &lt;/table&gt;
  </code></pre>
  
  <p><strong>Client Side code</strong>:</p>
  
  <pre><code> $('#tableQuery').DataTable({
              processing: true,
              ajax: {                    
                  data: {
                      remoteAction: 'GetProtocols'
                  },
                  dataSrc: 'records'
              },
              columns: [
                  {
                      'data': 'protocolo'
                  },
                  {
                      'data': 'cpf'
                  },
                  {
                      'data': 'requerente'
                  },
                  {
                      'data': 'status'
                  }
              ]
          });
  </code></pre>
  
  <p><strong>Server Side Code</strong>:</p>
  
  <pre><code>public void GetProtocols(HttpContext context)
  {
      context.Response.ContentType = "application/json; charset=utf-8";
      context.Response.Write("{ 'records': [{'protocolo': 'protTest1', 'cpf': '123.456.789-00', 'requerente': 'Fulano', 'status': 'Liberado'}]}");
  }
  </code></pre>
  
  <p><strong>Headers</strong>:
  <a href="https://i.stack.imgur.com/aFf6D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aFf6D.png" alt="Request/Response Headers"></a>
  <strong>Json Response</strong>:</p>
  
  <p><code>{ 
    'records': [
                 {'protocolo': 'protTest1', 'cpf': '123.456.789-00', 'requerente': 'Fulano', 'status': 'Liberado'}
               ]
  }</code></p>