mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-22 02:01:27 +00:00
Added method put; fix input raw_api and data
This commit is contained in:
parent
b1ca069656
commit
5eb9853a1c
|
@ -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)"
|
||||
|
|
Loading…
Reference in a new issue