How server respond for html, ajax, xml and json for rails app <p>In my rails app I send request in html, ajax, xml and json. For xml and json I do it by writing :format => 'json/xml', for ajax we write :remote => true. </p> <p>But how server know that it has to respond with ajax, xml or json? One thing I noticed when I send json or xml request it show in the url like below</p> <pre><code>http://localhost:3000/en/line_items.json </code></pre> <p>Though Im not sure, this is how server know if he has to give json response. But for html and ajax something like this is don't add in the url. So how server know whether it is ajax or html request?</p>