title: Is it possible to restrict a route for AJAX only?
body: <p>Is it possible to restrict a Symfony 2 route for XHR requests only? I want to declare routes, which are only accessible via AJAX.</p>
  
  <p>I do not want to put some extra lines into each AJAX-specific-actions like that:</p>
  
  <pre><code>if ($request-&gt;isXmlHttpRequest()) {
      // do something
  } else {
      // do something else
  }
  </code></pre>
  
  <p>I want to define:</p>
  
  <ul>
  <li>one rule for AJAX requests</li>
  <li>one rule for GET/POST requests to the same URL</li>
  </ul>
  
  <p>in order to get around having conditions like above.</p>