webserver: add support for passing JSON-RPC requests through HTTP GET arguments #1506

Merged
merged 1 commit into from Oct 5, 2012

Projects

None yet

1 participant

@Montellese
Owner

In addition to the existing support for sending JSON-RPC requests through HTTP POST requests to the webserver this commit adds support for JSON-RPC requests through HTTP GET arguments. There are two ways of doing a request through HTTP GET:

  1. Pass a full URL-encoded JSON-RPC request with the "request" argument
  2. Pass the name of the JSON-RPC method to be executed with the "method" argument. This does not allow to send parameters.

I made this based on a discussion with @amet on IRC where he stated that he will miss the way to execute a HTTP-API command simply by calling a HTTP URL once the HTTP-API has been completely replaced by JSON-RPC. So I added this functionality which will make this possible.

@Montellese Montellese webserver: add support for passing JSON-RPC requests through HTTP GET…
… arguments

In addition to the existing support for sending JSON-RPC requests through HTTP
POST requests to the webserver this commit adds support for JSON-RPC requests
through HTTP GET arguments by passing a full URL-encoded JSON-RPC request in the "request" GET argument.
331afa3
Owner

After a discussion with @topfs2 on IRC we have decided to not add the "method" argument shortcut because it's not really JSON-RPC anymore and doesn't allow for parameters etc. Therefore the only way to call a JSON-RPC method through HTTP GET is by url-encoding the request and passing it in the "request" GET argument.

@Montellese Montellese was assigned Oct 2, 2012
@Montellese Montellese merged commit f674404 into xbmc:master Oct 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment