graze / guzzle-jsonrpc Goto Github PK
View Code? Open in Web Editor NEWJSON-RPC 2.0 client for Guzzle
Home Page: https://packagist.org/packages/graze/guzzle-jsonrpc
License: MIT License
JSON-RPC 2.0 client for Guzzle
Home Page: https://packagist.org/packages/graze/guzzle-jsonrpc
License: MIT License
Hi,
I tried using this with a RPC server which has different URL paths for certain methods. For example when im executing "method1" the url maybe http://domain/login and when in other cases it maybe http://domain/execute
Does this package support this or will this be added sometime in the future?
It would be great to make it compatible with Guzzle 3.8
This make json rpc request Invalid
I use this package on Drupal 8, but composer can no longer resolve because Drupal needs Guzzle 6.
At now haven't way to set Guzzle headers. I can't send request with basic auth.
Hi, first of all, thank you for your implementation of JSON-RPC for Guzzle.
I had some problems with it, specially with EventDispatcher. I think when your create your Request type, you must set to it EventDispatcher from client:
// path/to/vendor/Graze/Guzzle/JsonRpc/Message/Request.php
public function __construct(RequestInterface $request, $method, $id = null)
{
parent::__construct($request->getMethod(), $request->getUrl(), $request->getHeaders());
$this->setClient($request->getClient());
// this fixes the problem
$this->setEventDispatcher($request->getClient()->getEventDispatcher());
$this->rpcFields = new Collection(array(
'jsonrpc' => JsonRpcClientInterface::VERSION,
'method' => (string) $method
));
if (null !== $id) {
$this->setRpcField('id', $id);
}
}
I had problems when used MisdGuzzleBundle. This bundle allows to log requests, but it does not work with your client, because it has not correct EventDispatcher.
Guzzle 5 will come with a replacement implementation for the transport adapters. To be compatible with version 5 we will need to change the BatchAdapter accordingly.
This can be done in tandem by using the guzzlehttp/guzzle
package and versioning this library correctly.
Some rpc require parameters be sent as object type instead of array, but guzzle requires everything to be array.
Hi,
are there plans to update this package to be compatibel with Guzzle 7?
Thanks!
In JSON-RPC specification you can send an array or request and receive an array of responses.
In some scenarios, it may slightly increase performance in the library will send N asynced HTTP requests with M JSON-RPC requests in each.
src/Message/MessageFactory.php contains 2 methods: fromResponse() and createRequest() that can throws undeclared InvalidArgumentException. Fix it, please.
The current implementation accepts only the following error codes:
array_merge(array(-32700), range(-32600, -32603), range(-32000, -32099))
This is the source code from "JsonRpc/Message/ErrorResponse.php".
However, the JSON-RPC specification allows any integer. See (http://www.jsonrpc.org/specification) which says: "5.1 Error object -> code -> A Number that indicates the error type that occurred. This MUST be an integer."
That's all. After that a few reserved codes for pre-defined errors are listed. It seems that you've misinterpreted those reserved codes as the only one which are accepted. While actually, those reserved codes should be used as specified and "the remainder of the space is available for application defined errors."
Please allow us to use arbitrary integer error codes in our applications.
Make the functional tests run on HHVM
The server fails to run in PHP 5.6.0 on Travis-CI but work fine on 5.6.0-1 in development.
# Travis CI
$ php --version
PHP 5.6.0 (cli) (built: Sep 3 2014 23:16:07)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
# Development
php --version
PHP 5.6.0-1+deb.sury.org~precise+1 (cli) (built: Sep 10 2014 14:24:05)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.