WellRESTed is a library for creating RESTful APIs and websites in PHP that provides abstraction for HTTP messages, a powerful middleware system, and a flexible router.


use App\ServiceProvider;
use Pimple\Container;
use WellRESTed\Server;


$c = (new Container())->register(new ServiceProvider())

$server = new Server();
        ->register('GET', '/', $c['index'])
        ->register('GET', '/cats/', $c['getCatsList'])
        ->register('POST', '/cats/', [
        ->register('GET', '/cats/{id}', $c['getCat'])
        ->register('PUT', '/cats/{id}', [
        ->register('DELETE', '/cats/{id}', [



Requests and responses are built to the interfaces standardized by PSR-7 making it easy to share code and use components from other libraries and frameworks.


Build your application using handlers and middleware implementing the interfaces defined by PSR-15.


Use a router to map HTTP methods and paths to hanlders, middleware, or sub-routers.

URI Templates

Use URI templates like /foo/{bar}/{baz}, /list/{items*}, or {/path*} that match patterns of paths and provide captured variables.

Lazy Dispatching

WellRESTed's dispatcher can delay instantiating handlers until they're needed, so even large apps can stay light weight.

Dependency Injection

WellRESTed does not supply a DI container; it's designed to play nicely with the container of your choice.


The recommended method for installing WellRESTed is to use Composer. Add an entry for WellRESTed in your project’s composer.json file.

  "require": {
     "wellrested/wellrested": "~3.1"



The documentaiton for WellRESTed is available at https://wellrested.readthedocs.io