diff --git a/pleroma-cli.sh b/pleroma-cli.sh index ca8f36b..fb3f830 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -60,9 +60,14 @@ make_login() { curl -s --compressed -X POST -H "Authorization: Bearer $auth" "$@" } + put_request() + { + curl -s --compressed -X PUT -H "Authorization: Bearer $auth" "$@" + } echo '+Authorized account+' export default_curl_opt export post_request + export put_request else default_curl_opt() { @@ -908,7 +913,7 @@ custom_manual_api_request() { while true; do echo 'Select request method:' - method=$(echo 'get\npost' | fzy) + method=$(echo 'get\npost\nput' | fzy) echo 'Input api request: api/v1/...' case $method in 'get') @@ -917,7 +922,15 @@ custom_manual_api_request() ;; 'post') read raw_api - post_request --url "https://$instance/$raw_api" | jj -p + echo 'input curl data flags: --data-urlencode "example=example"' + read flags + post_request $flags --url "https://$instance/$raw_api" | jj -p + ;; + 'put') + read raw_api + echo 'input curl data flags: --data-urlencode "example=example"' + read flags + put_request $flags --url "https://$instance/$raw_api" | jj -p ;; esac echo "Done, exit? (y/N)"