shroophp / restful
A library for building RESTful applications with ShrooPHP.
v1.0.5
2019-11-07 00:41 UTC
Requires
- php: >=7.1
- shroophp/framework: ^3.0 || ^2.1
Requires (Dev)
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^4.8
- shroophp/psr: ^1.0
This package is not auto-updated.
Last update: 2024-12-08 10:52:47 UTC
README
A PHP library for building RESTful applications.
Installation
composer require 'shroophp/restful ^1.0'
Example Usage
<?php
use ShrooPHP\Framework\Application;
use ShrooPHP\RESTful\Collections\HashTable;
use ShrooPHP\RESTful\Resources\Immutable;
use ShrooPHP\RESTful\Request\Handler;
require 'vendor/autoload.php';
$collection = new HashTable;
$handler = new Handler($collection);
$resource = new Immutable('Hello, world!', 'text/plain');
$collection->put('/', $resource);
(new Application)->push($handler)->run();