Skip to content

fordnox/php-json-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages