title: Invalid JSON response using CURL
body: <p>I have a problem with the play framework 2.1.1 (Java) telling me that I am sending Invalid JSON. There has been a similar /possibly the same issue for the play framework 2.x and 2.1.0, but it was supposed to be resolved in play framework 2.1.1 afaik: See <a href="https://stackoverflow.com/questions/14804162/invalid-json-in-playframework-2-1-test-post-request">Invalid JSON in Play Framework 2.1</a></p>
  
  <p>This is what I am doing in the code, I have tried making it a bit shorter:</p>
  
  <pre><code>import org.codehaus.jackson.JsonFactory;
  import org.codehaus.jackson.JsonNode;
  import org.codehaus.jackson.JsonParser;
  import play.libs.Json;
  import play.mvc.BodyParser;
  
  @BodyParser.Of(BodyParser.Json.class)
  public static Result login() {
      JsonNode json = request().body().asJson();
  }
  </code></pre>
  
  <p>When I run:</p>
  
  <pre><code>curl -v -H "Content-Type: application/json" -X POST -d '{"email":"test@test.de","password":"test"}' http://localhost:9000/mobile/login
  </code></pre>
  
  <p>I get the following response:</p>
  
  <pre><code>&lt; HTTP/1.1 400 Bad Request
  &lt; Content-Type: text/html; charset=utf-8
  &lt; Content-Length: 1917
  ...
  &lt;p id="detail"&gt;
      For request 'POST /mobile/login' [Invalid Json]
  &lt;/p&gt;
  ...
  </code></pre>
  
  <p>I have cleaned my project and rerun it several times. When running <em>play about</em> I get the following output:</p>
  
  <pre><code>[info] Loading project definition from /path/to/project
  [info] Set current project to FFPushAlarmPlay (in build file:/path/to)
  [info] This is sbt 0.12.2
  [info] The current project is {file:/path/to}...
  [info] The current project is built against Scala 2.10.0
  [info] Available Plugins: play.Project, sbt.PlayProject, com.typesafe.sbteclipse.plugin.EclipsePlugin, com.typesafe.sbtidea.SbtIdeaPlugin
  [info] sbt, sbt plugins, and build definitions are using Scala 2.9.2
  </code></pre>
  
  <p>Am I doing something awfully wrong? Any help would be greatly appreciated as this is my first Play 2 project!</p>
  
  <p><strong>Update:</strong> I forgot to mention that I also have an iOS client which automagically builds the JSON using AFNetworking and I also get a Invalid JSON response there. So it doesn't seem to be invalid JSON causing this...</p>