Closed bstrahija closed 10 years ago
There you go! graze/guzzle-jsonrpc@0.3.0.
Isn't working with custom headers and auth.
If you could explain the problems you're having in more detail I might be able to help.
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
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
$method
is the method name for the JSON-RPC Request Object$id
is the request ID for the JSON-RPC Request Object$params
are the structured parameters for the JSON-RPC Request Object$url
is the request URL which can be omitted and use the URL from the $client
$headers
are your custom HTTP headers (including your auth headers)Beyond this, I don't know what problems you could be facing. Maybe when you have time you could elaborate.
It would be great to make it compatible with Guzzle 3.8