title: Implementing Ajax calls for a REST API
body: <p>I have built a back end REST API using Slim Framework and followed the REST format as close as I could.</p>
  
  <p>Once I started working on the Front End I realized that AJAX works great with parameters and not paths</p>
  
  <p>(param file?param=value , paths file/object/method/id)</p>
  
  <p>I am planning on out sourcing or building an APP with xamarin or other 3rd party to consume the API, but for now a Alpha test will be done with HTML and AJAX calls.</p>
  
  <p>Example call   example.com/user/test   or example.com/advertiser/2</p>
  
  <p>So how do I query the API, do I just concat URL strings? </p>
  
  <p>.ajax({ ...  url : 'example.com/user/'+user ...}); </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Yes I know AJAX is domain sensitive, and Yes I am using verbs GET,POST,PUT and DELETE.</p>
  
  <p>What is going on is the following :</p>
  
  <p>When passing variables in an AJAX request they get appended as </p>
  
  <p>PARAMS example.com/users/?user=Pogrindis</p>
  
  <p>in an REST API at least as far as I read it goes </p>
  
  <p>example.com/users/Pogrindis that's a path </p>
  
  <p>reference parse.com/docs/rest#general-quick</p>