title: trailing slash for a php web service
body: <p>I'm new in webservice and I created a little example.</p>
  <p>The code is:</p>
  <pre><code>$json_encoded = file_get_contents('php://input');
  $array = json_decode($json_encoded, true);
  if ( count($array) ) {
     echo &quot;OK: data received&quot;;
  } else {
     echo &quot;NO data received&quot;;
  }
  </code></pre>
  <p>This little script is located at <code>http://www.example.com/api/check/index.php</code></p>
  <p>Now if I try to use POSTMAN software to test it wth a json payload, it works great if I use a POST call at <code>http://www.example.com/api/check/</code> :</p>
  <pre><code>OK: data received
  </code></pre>
  <p>But if I try to send a request to the same address without trailing slash <code>http://www.example.com/api/check</code> i get:</p>
  <pre><code>NO data received
  </code></pre>
  <p>Is there a way to get it working for both calls (with and without trailing slash) ?</p>
  <p>I cannot edit server config, so i'd like to get it working editing <code>index.php</code> or adding an <code>.htaccess</code> here <code>http://www.example.com/api/check/</code></p>
  <p>Any suggest?</p>