title: How to work with the "type"/"method" set in the AJAX request in the PHP API
body: <p>I created a PHP API to work with userdata saved in a database. I access it via AJAX requests.</p>
  
  <p>When I start an AJAX request, it looks like this:</p>
  
  <pre><code>$.ajax({
    type: "GET",
    ...
  });
  </code></pre>
  
  <p>My question is: how does the receiving *.php-file know what it is supposed to do? AJAX determines, that it is supposed to be a GET-request but in the *.php-file there is code to get users, save users (POST), update users (PUT) and so on. Do I have to build a <code>switch-case-statement</code> in the *.php-file?</p>
  
  <p>Or am I missunderstanding a concept here? </p>