Now I changed $jsonArray = array( 'username' => $user ->getUsername(), 'password' => $user ->getPassword() ); to $jsonArray = array( 'username' => 'foo', 'password' => 'bar' ); and refactor some errors in the controllers and the response is 200 :)