Skip to content
Most simple JSON API builder class for PHP. Accepting a JSON request body and returning JSON as a result
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Fordnox
tests
.gitignore
.travis.yml
README.md
composer.json
phpunit.xml.dist

README.md

Build Status

php-json-api

Most simple JSON API builder class for PHP. One file only. Accepting a JSON request body and returning JSON as a result.

Example Server

<?php
require __DIR__ . '/../vendor/autoload.php';

$server = new Fordnox\JsonApiServer();
$server->register('ping', function($params){
    return $params;
});
$server->handle();

Example Invoke

curl http://api.com -d '{"method":"ping","params":"pong!"}'

{"result":"pong!", "error":null}
You can’t perform that action at this time.