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

Information

RBTools
master

Reviewers

The reason why we need api command instead of api-get is simple: We need to do HTTP GET, POST, PUT, DELETE requests.
I created api 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 9

This is not the most recent revision of the diff. The latest diff is revision 18. See what's changed.

orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Commits

First Last Summary ID Author
Merge XDG project changes in local branch into local master
13e4b1d3a98ebb31a701b4c80c457da035d050c0 Qianxi Li
[WIP]Add a new command called "api". Add option commands called "--get", "--p...
f5d08321dbf89a392a282e30b1cc4eba4f0d406e Qianxi Li
[WIP]Add api.py file, forget to stage this file in the last commit.
39de827276ea422dea3fc1f630d35c17f415ab9c Qianxi Li
[WIP]Add "--put" option but still need to find out how to send post/put data....
9300eb1518e3b078f03aeb388b7f91821e915c7f Qianxi Li
Refactor methods in api class. Now support use --header option to add customi...
604bed2b22deb3145dcf7339753bd2096d9d8889 Qianxi Li
[WIP]Allow basic HTTP GET, DELETE. Allow POST and PUT key value pairs. Still ...
f12ccfbf6346c75a934fdf6e70ee37c6e5c38702 Qianxi Li
Remove redundant print statements from api-get.py
dc104eaacfc259f3466e0c0cf14982ccc21da57e Qianxi Li
Fix coding style problems.
dc4fcf3ccc29f5d6ab8243ade250c9ff830730e9 Qianxi Li
Fix more coding style problems.
027ac7cc1ef765176d3c8a98c8fa09e9295a4378 Qianxi Li
Add a newline character.
3058676f474918449c806faea1fe1787e168e659 Qianxi Li
Change create create_cookie_jar function. Edit test_create_cookie_jar. Fix co...
44efa2f7a4d647cba179c40223fa31685614cd15 Qianxi Li
Api testing
e5c49dad1d97276dbe9e4a21edb136e7984ee54e Qianxi Li
Test "--post" and "--put" options.
53939217e08588c88d4a410bab2b4337e8ebcfd8 Qianxi Li
Revert "Change create create_cookie_jar function. Edit test_create_cookie_jar...
This reverts commit 44efa2f7a4d647cba179c40223fa31685614cd15.
5068e0c14b5c564f8917f221100b9b6fc084f563 Qianxi Li
Revert "Merge XDG project changes in local branch into local master"
This reverts commit 13e4b1d3a98ebb31a701b4c80c457da035d050c0.
d3baaf085443b05301478c034acc24631dfedd2b Qianxi Li
Fix coding style problems.
921d578ffcec441f0047bc4f4c4fc8cd3c74673c Qianxi Li
Add "--patch" and "--file" options. Finish testing "--post", "--put", "--get"...
e5529638e506d696280d0f28377f017729fe53a3 Qianxi Li
Fix coding style problems.
41fca77f0fcf26e86c9cef616e2e9ab8ce7dd371 Qianxi Li
Fix file upload problem.
8b092c2d0797f6f2f367d0a27d163dff221f0076 Qianxi Li
setup.py
contrib/tools/git-hook-check-approval
rbtools/.DS_Store
rbtools/api/client.py
rbtools/api/factory.py
rbtools/api/request.py
rbtools/api/transport/sync.py
rbtools/commands/__init__.py
rbtools/commands/api.py
rbtools/commands/api_get.py
rbtools/commands/main.py
rbtools/utils/filesystem.py
Loading...