graze / guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle
https://packagist.org/packages/graze/guzzle-jsonrpc
MIT License
93 stars 61 forks source link

[Proposal] Guzzle 3.8 #6

Closed bstrahija closed 10 years ago

bstrahija commented 10 years ago

It would be great to make it compatible with Guzzle 3.8

adlawson commented 10 years ago

There you go! graze/guzzle-jsonrpc@0.3.0.

bstrahija commented 10 years ago

Isn't working with custom headers and auth.

adlawson commented 10 years ago

If you could explain the problems you're having in more detail I might be able to help.

bstrahija commented 10 years ago

Currently I a little bit short on time, but it seems like the headers are not set at all. Also the auth part.

I was following the docs on: http://guzzle.readthedocs.org/en/latest/index.html

adlawson commented 10 years ago

Make sure you give your arguments in the correct order. The docs at http://guzzle.readthedocs.org/en/latest/index.html refer to normal Guzzle methods, where the headers appear much earlier in the argument list, and are therefore not relevant to this library.

$method = 'method';
$id = 123;
$params = ['key' => 'value'];
$url = null;
$headers = ['auth' => ['user' => 'pass']];

$client = new \Graze\Guzzle\JsonRpc\JsonRpcClient('http://localhost:8000');
$request = $client->request($method, $id, $params, $url, $headers);

Where

Beyond this, I don't know what problems you could be facing. Maybe when you have time you could elaborate.