shroophp/restful

A library for building RESTful applications with ShrooPHP.

v1.0.5 2019-11-07 00:41 UTC

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();