title: Play Framework CSRF error "[CSRF] Check failed because no token found in headers"
body: <p>I'm new in Play Framework, and trying to submit the form, but
  get this error: "p.filters.CSRF - [CSRF] Check failed because no token found in headers" . I'm using Play 2.6, here's my controller code: </p>
  
  <pre><code>    package controllers;
  
  import play.libs.Json;
  import play.mvc.*;
  
  import views.html.*;
  
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Map;
  
  public class HomeController extends Controller {
  
      public Result index() {
          return ok(index.render("Your new application is ready."));
      }
  
      public Result test() {
          List&lt;String&gt; list = new ArrayList&lt;&gt;();
          list.add("Jobs");
          list.add("Work");
          list.add("Say");
          list.add("Stop");
          return ok(test.render("test", list));
      }
  
      public Result testPost() {
         Map&lt;String,String[]&gt; form =  request().body().asFormUrlEncoded();
         return ok(Json.toJson(form)).as("application/json");
      }
  
  }
  </code></pre>
  
  <p>Template: </p>
  
  <pre><code>@(title: String, list: List[String])
  
  @import helper._
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;title&gt;@title&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form action="/test" method="post"&gt;
              &lt;textarea name="raw_text"&gt;
  
              &lt;/textarea&gt;
              @CSRF.formField
              &lt;input type="submit" value="Submit" /&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What I am doing wrong?</p>