Add a new `rbt api` command and support `--get`, `--put`, `--post` and `--delete` options.
Review Request #11479 — Created Feb. 21, 2021 and updated — Latest diff uploaded
The reason why we need api command instead of api-get is simple: We need to do HTTP GET, POST, PUT, DELETE requests.
I createdapi
command, with new options--get
,--post
,--put
,--delete
,--patch
,--file="local path"
,--data='key1=value1'
,--header='headercontent'
, original--pretty
option and server options still work.
For api
--get
,--post
,--put
,--delete
options, I did some testings using command line tools.I created a review request draft and used my
--get
,--post
,--put
and--delete
options, they all worked fine.
I posted several files to the review request draft using--post
and--file
options and they worked.
I don't think our reviewboard APIs support--patch
at this moment so I just left it there in case one day it will be useful.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 18. See what's changed.
Commits
Files
.DS_Store |
---|
setup.py |
---|
contrib/tools/git-hook-check-approval |
---|
rbtools/.DS_Store |
---|
rbtools/api/client.py |
---|
rbtools/api/request.py |
---|
rbtools/api/tests/test_http_request.py |
---|
rbtools/api/transport/sync.py |
---|
rbtools/commands/.DS_Store |
---|
rbtools/commands/__init__.py |
---|
rbtools/commands/api.py |
---|
rbtools/commands/api_get.py |
---|
rbtools/commands/main.py |
---|
rbtools/commands/setup_repo.py |
---|
rbtools/commands/tests/test_setup_repo.py |
---|
rbtools/utils/appdirs.py |
---|
rbtools/utils/filesystem.py |
---|