title: What mistake I'm making in calling an API written in Slim?
body: <p>I'm using Slim framework to access the functions from existing PHPFox website. I'm just a newbie to Slim framework so truing to learn it. </p>
  
  <p>I've included the necessary file for this. But the issue I'm facing is I'm always getting <strong>"404 Page Not Found"</strong> error upon making request. Even I tried to print the message "Object Created" after creation of object, it got printed that means till this point there is no error. When I try to get inside the function by echoing some message I got 404 error. </p>
  
  <p>Can someone please help me in correcting the mistake I'm making in my code?</p>
  
  <p>Following is my code (<strong>login_ws.php</strong>): </p>
  
  <pre><code>&lt;?php
  
      require 'Slim/Slim.php';
      require('config.php');
  
      \Slim\Slim::registerAutoloader();
  
      //Instantiate Slim class in order to get a reference for the object.
      $application = new \Slim\Slim();
      //Object created
      $application-&gt;map (
          '/login/:login/:password/:divice_type', 
  
          function()
          { echo "Ina funcionality"; die;
              global $application;
              if($application-&gt;request-&gt;isGet()) {
                  $login        = $application-&gt;request-&gt;get('login');
                $password     = $application-&gt;request-&gt;get('password');
                $divice_type  = $application-&gt;request-&gt;get('divice_type');
                /*$divice_token = $application-&gt;request-&gt;get('divice_token');*/
              }  
              if($application-&gt;request-&gt;isPost()) {
                  $login        = $application-&gt;request-&gt;post('login');
                $password     = $application-&gt;request-&gt;post('password');
                $divice_type  = $application-&gt;request-&gt;post('divice_type');
                /*$divice_token = $application-&gt;request-&gt;post('divice_token');*/
              }
              list($bLogged, $aUser) = Phpfox::getService('user.auth')-&gt;login($login, $password);
              if($aUser['user_image']) {
              $aUser['user_image'] = Phpfox::getParam('core.url_user').$aUser['user_image'];
          } else {
                  $aUser['user_image'] = '';
              }
  
  
              if((!empty($aUser)) &amp;&amp; ($bLogged&gt;0)) {
                  $msg='Login succesfully';
                  Phpfox::getService('user.auth')-&gt;setUserId($aUser['user_id']);
                  $appKey = Phpfox::getService('apps')-&gt;getKey('3');
  
                  $test = doPost("http://localhost/token.php?key=".$appKey);
                  $arrayToken = json_decode($test);
  
                $aUser['token'] = $arrayToken-&gt;token;
                  $aUser['key'] = $appKey;
                } else {
                  $msg='Login Failed';
                  $aUser[]=$login;
                  $aUser[]=$password;
              }
                $result=array('status'=&gt;$bLogged ? 'true' : 'false','data'=&gt;$aUser,'msg'=&gt;$msg);
                header("Content-Type: application/json");
                echo json_encode($result);
          }
      )-&gt;via('GET','POST');
      //Purpose of via() : The function will be invoked when there is a match for the URI whether the request is using HTTP GET or HTTP POST method.      
      $application-&gt;run();
  
      function doPost($aParams) {
  
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
          curl_setopt($ch, CURLOPT_URL, $aParams);
          curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_setopt($ch, CURLOPT_POST, 1);
  
          $result = curl_exec($ch);
          curl_close($ch);        
          return $result;
      }
  ?&gt;
  </code></pre>
  
  <p>The request I'm making through browser's URL is as follows:</p>
  
  <pre><code>http://localhost/webservice/login_ws.php/login?login=admin@gmail.com&amp;password=admin123&amp;divice_type=iphone
  </code></pre>
  
  <p>Please help me in correcting the mistake I'm making. Also if you find I'm doing anything in wrong way which is not standard for Slim framework please correct me. I'd be more than happy for it.</p>
  
  <p>Thanks.</p>