datto / php-json-rpc-http

HTTP client and server for JSON-RPC 2.0
GNU Lesser General Public License v3.0
60 stars 23 forks source link

support "Bitmask consisting" for relay #8

Closed twocolors closed 4 years ago

twocolors commented 4 years ago

all relay in json, but want use some "Bitmask consisting" for json_encode

smortensen commented 4 years ago

Hmm... I'd like to help, but I don't understand the request.

twocolors commented 4 years ago

support set JSON_UNESCAPED_UNICODE (and other) in relay.

smortensen commented 4 years ago

Understood. I should be able to get this out tomorrow.

smortensen commented 4 years ago

I just wanted to let you know that I've updated the underlying json-rpc package so you can make changes to the JSON format.

Sometimes, people use the JSON client in combination with a third-party client, like Guzzle. In that case, you should be all set to use the new JSON client.

However, if you want to use this lighter-weight "php-json-rpc-http" library, then we'll make a few additional changes for you. This HTTP package instantiates the JSON client internally, within its constructor, and it keeps the JSON client private. We'll have to inject the client, or expose the methods, so you can use your own alternative format.

At any rate, let me know what you think... I'll go ahead with the HTTP changes if you'll use them.

smortensen commented 4 years ago

Here's a look at the new client methods: https://github.com/datto/php-json-rpc/blob/master/src/Client.php#L113-L147 https://github.com/datto/php-json-rpc/blob/master/src/Client.php#L179-L210

And here is the matching server method: https://github.com/datto/php-json-rpc/blob/master/src/Server.php#L82-L108

You can skip the built-in JSON-encoding in favor of your own.

twocolors commented 4 years ago

thx, mb this help https://github.com/datto/php-json-rpc-http/issues/9 ?