Bench request command

Hello all

I’m trying to figure out how to use the bench request command.

From Frappe Commands

request : Make a request as Administrator with Arguements to a Path

and

bench request --help

gives

–args TEXT arguments like ?cmd=test&key=value or /api/request/method?..
–path TEXT path to request JSON

However I cannot get it to return anything. Has anyone used this command?

I’m using both a RPC method and a REST endpoint to try and get it to work. No matter how I configure the --path and --args parameters, I get either a 404 or the same traceback.

RPC : /api/method/frappe.handler.version

bench request --path /api/request/frappe.handler.version
bench request --path /api/request/method?frappe.handler.version
bench request --path /api/request/method? --args frappe.handler.version
bench request --path /api/method/frappe.handler.version

REST : /api/resource/User

bench request --args /api/request/method/User
bench request --path /api/resource/User
… many other attempts

It makes no difference whether I invoke it as cd frappe-bench; bench --site site1.local request …
All I get is either a 404 or the following traceback.

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 99, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 26, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 585, in request
frappe.local.form_dict = frappe._dict([a.split(“=”) for a in args.split(“?”)[-1].split(“&”)])
ValueError: dictionary update sequence element #0 has length 1; 2 is required