Skip to content

binwiederhier/php-json-rpc-http

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON-RPC for PHP

Features

  • Fully compliant with the JSON-RPC 2.0 specifications (with 100% unit-test coverage)
  • Flexible: you can choose your own system for interpreting the JSON-RPC method strings
  • Dependable: works even when CURL is not installed
  • Minimalistic (just two tiny files)
  • Ready to use, with working examples

Requirements

  • PHP >= 5.3

License

This package is released under an open-source license: LGPL-3.0

Examples

Client

$client = new Client('http://api.example.com');

$client->query(1, 'add', array(1, 2));

$reply = $client->send();

Server

$server = new Server(new Api());

$server->reply();

See the "examples" folder for ready-to-use examples.

Installation

If you're using Composer, you can use this package (datto/json-rpc-http) by inserting a line into the "require" section of your "composer.json" file:

        "datto/json-rpc-http": "~3.0"

Getting started

  1. Try the examples! Follow the README file in the "examples" directory to set up a development web environment. Run the examples from the project directory like this:

    php examples/client.php
    
  2. Once your example is working, replace the example "src" code with your own code.

  3. Use your new API in a project.

Author

Spencer Mortensen

About

HTTP client and server for JSON-RPC 2.0

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%