Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't do a GET with JsonRPC like : http://.../jsonrpc/app.trimTails?{...} #15

Open
stphdenis opened this issue Mar 31, 2010 · 2 comments
Labels

Comments

@stphdenis
Copy link

When using DojoToolkit we can have things like :
http://.../jsonrpc/app.trimTails?{"id":"0", "method":"app.trimTails", "params":{"nom":"iuhoi"}, "jsonrpc":"2.0"}

Like it does not work with django-json-rpc I have modified the validate_get method of site.py in my sources as :

if request.method == 'GET':
  method = unicode(method)
  if method in self.urls and getattr(self.urls[method], 'json_safe', False):
    #### sd 2010/03/31 ## BEGIN ##
    params = request.GET.lists()
    if len(params) == 1 and len(params[0]) == 2:
      k = params[0][0]
      if k[0] == '{':
        try:
          D = loads(k)
          return True, D
        except:
          pass
    D = {
      'params': encode_get_params(params),
    # 'params': encode_get_params(request.GET.lists()),
    #### modif sd ## END ##
      'method': method,
      'id': 'jsonrpc',
      'version': '1.1'
    }
    return True, D
return False, {}

If it can help...

@samuraisam
Copy link
Owner

How common is this style of GET RPC? I don't see its support in the spec.

Only 1.1 supports HTTP GET and its intended use is for idempotent, safe methods which work well with HTTP GET.

@samuraisam
Copy link
Owner

Please write this as a pull request and I can merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants