Overview

Each Slim application instance has one request object. The request object is an abstraction of the currentHTTP request and allows you to easily interact with the Slim application’s environment variables. Although eachSlim application includes a default request object, the \Slim\Http\Request class is idempotent; you mayinstantiate the class at will (in middleware or elsewhere in your Slim application) without affecting the applicationas a whole. You can obtain a reference to the Slim application’s request object like this:

  1. <?php
  2. // Returns instance of \Slim\Http\Request
  3. $request = $app->request;