foglcz / JSONRpc2

Generic JSON-RPC v2 implementation
Other
19 stars 10 forks source link

Allowing GET for making RPC calls? #9

Closed scottchiefbaker closed 10 years ago

scottchiefbaker commented 10 years ago

I have some preliminary code landed to allow RPC calls via GET. I've seen some other libraries allow calls via GET for simplicity, so I thought I'd try and implement it. Is this something you think we should allow? Maybe disable it by default, but allow it to be enabled at runtime? A URL like this:

http://server.com/json-rpc/api.php?method=cust.get&params=Jason,Doolis,123

This make scripting RPC calls from the command line easy, because we don't have to generate a POST. What are your thoughts?

scottchiefbaker commented 10 years ago

You can see the preliminary code I have for this on my allow_get_calls branch

https://github.com/scottchiefbaker/php-JSON-RPC/blob/allow_get_calls/lib/Server.php#L608

foglcz commented 10 years ago

Makes sense, good idea and cool code!

+1

scottchiefbaker commented 10 years ago

Ok I'll land this code then, and send you a pull request.

scottchiefbaker commented 10 years ago

Closing because #10 addresses this.