404在POST上但在GET Slim应用程序上没有

    <?php
    /**
     * Step 1: Require the Slim Framework
     *
     * If you are not using Composer, you need to require the
     * Slim Framework and register its PSR-0 autoloader.
     *
     * If you are using Composer, you can skip this step.
     */
    require 'Slim/Slim.php';
    require 'routes/db.php';
    require 'routes/getmovies.php';
    require 'routes/getmovieaboverating.php';
    require 'routes/getid.php';


    \Slim\Slim::registerAutoloader();

    /**
     * Step 2: Instantiate a Slim application
     *
     * This example instantiates a Slim application using
     * its default settings. However, you will usually configure
     * your Slim application now by passing an associative array
     * of setting names and values into the application constructor.
     */
    $app = new \Slim\Slim();

    /**
     * Step 3: Define the Slim application routes
     *
     * Here we define several Slim application routes that respond
     * to appropriate HTTP request methods. In this example, the second
     * argument for `Slim::get`, `Slim::post`, `Slim::put`, `Slim::patch`, and `Slim::delete`
     * is an anonymous function.
     */

    // GET route
    $app->get(
        '/',
        function () {
          echo "<h1> HomeWork Assignment 2</h1>";
        }
    );
    $app->get(
        '/movies/',
        function () {
          getMovies();
        }
    );
    $app->get(
        '/movies/id/:movieid',
        function ($movieid) {
          getMovieDetail($movieid);
        }
    );
    $app->get(
        '/movies/rating/:rating',
        function ($rating) {
          getMoviesAboveRating($rating);
        }
    );

    // POST route
    $app->post(
        '/post/',function () use ($app){

            echo 'This is a POST route';
            //$json=$app->request->getBody();
            //$data=json_decode($json,true);
            //echo $data['name'];
            //echo $data['description'];
            //echo $data['rating'];
            //echo $data['url'];
        }
    );

    $app->put(
        '/put',
        function () {
            echo 'This is a PUT route';
        }
    );

    // PATCH route
    $app->patch('/patch', function () {
        echo 'This is a PATCH route';
    });

    // DELETE route
    $app->delete(
        '/delete',
        function () {
            echo 'This is a DELETE route';
        }
    );

    /**
     * Step 4: Run the Slim application
     *
     * This method should be called last. This executes the Slim application
     * and returns the HTTP response to the HTTP client.
     */
    $app->run();

When i do www.example.com/movies/ I am geting the result,

But, When i do www.example.com/post/ I am getting 404 Page not Found. Do I have to do any thing else? I am just doing echo. Can any one tell me how do I solve this issue

For a POST path in Slim, you have to POST a request to www.example.com/post/. Loading that URL in a browser tab (a GET request) won't invoke the callback function.

Slim docs say:

Use the Slim application's post() method to map a callback function to a resource URI that is requested with the HTTP POST method.

You can test your requests thoroughly with a HTTP requesting service like https://www.hurl.it/