PHPackages                             mdjward/php-rpc-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mdjward/php-rpc-client

ActiveLibrary[API Development](/categories/api)

mdjward/php-rpc-client
======================

Web Service RPC Client for PHP

1.0.0(11y ago)015PHPPHP &gt;=5.3

Since Jul 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/mdjward/php-rpc-client)[ Packagist](https://packagist.org/packages/mdjward/php-rpc-client)[ RSS](/packages/mdjward-php-rpc-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

php-rpc-client
==============

[](#php-rpc-client)

Web Service RPC client implementation for PHP.

This is a project I worked on a while back, so there are probably much better implementations out there at present.

The library aims to provide a simple, transparent means of working with RPC-based web services, using [Guzzle](http://guzzle.readthedocs.org/en/latest/) as the underlying HTTP client library. At present, it supports:

1. [JSON-RPC](http://json-rpc.org/) (versions 1.0 and 2.0);
2. [XML-RPC](http://xmlrpc.scripting.com/default.html);
3. The RPC format used by the [Transmission](https://www.transmissionbt.com/) BitTorrent engine.

Making a request
----------------

[](#making-a-request)

Generally this library takes advantage of [magic methods](http://www.php.net/manual/en/language.oop5.magic.php) in PHP (specifically [\_\_get](http://www.php.net/manual/en/language.oop5.overloading.php#object.get) and [\_\_call](http://www.php.net/manual/en/language.oop5.overloading.php#object.call)), in much the same way as the PHP SOAP client to invoke web service methods under multiple levels of namespace.

### Example: Updating XBMC's media library

[](#example-updating-xbmcs-media-library)

The popular [XBMC media centre](http://xbmc.org/) makes use of JSON-RPC v2 in the [extensive web service](http://wiki.xbmc.org/?title=JSON-RPC_API/v6) it offers for remote control purposes.

To invoke it's [VideoLibrary.Scan](http://wiki.xbmc.org/?title=JSON-RPC_API/v6#VideoLibrary.Scan) method with an empty string parameter, on a server running on :

```
