File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ parseArguments()
6767 fi
6868}
6969
70+ uriencode ()
71+ {
72+ jq -nr --arg v " $1 " ' $v|@uri' ;
73+ }
7074# ##############main############
7175
7276parseArguments " $@ "
@@ -84,7 +88,10 @@ data=$(jq --arg name $username --arg pass $password --arg dname $domainname --ar
8488jwt=$( curl -k -X POST $uri -H $content_header -d " $data " | jq --raw-output ' .token' )
8589
8690param1=" filter=policyType eq 'Standard'"
87- param2=" page[limit]=10"
91+
92+ # ## To use filter page[limit] in URI, The key 'page[limit]' must be url encoded already. ###
93+ # ## Curl --data-urlencode encodes only the content part of the data of the form 'name=content' ###
94+ param2=" $( uriencode ' page[limit]' ) =10" # op: page%5Blimit%5D=10
8895
8996# #############jobs##############
9097
Original file line number Diff line number Diff line change @@ -67,6 +67,11 @@ parseArguments()
6767 fi
6868}
6969
70+ uriencode ()
71+ {
72+ jq -nr --arg v " $1 " ' $v|@uri' ;
73+ }
74+
7075# ##############main#############
7176
7277parseArguments " $@ "
@@ -84,7 +89,10 @@ data=$(jq --arg name $username --arg pass $password --arg dname $domainname --ar
8489jwt=$( curl -k -X POST $uri -H $content_header -d " $data " | jq --raw-output ' .token' )
8590
8691param1=" filter=jobType eq 'BACKUP'"
87- param2=" page[limit]=10"
92+
93+ # ## To use filter page[limit] in URI, The key 'page[limit]' must be url encoded already. ###
94+ # ## Curl --data-urlencode encodes only the content part of the data of the form 'name=content' ###
95+ param2=" $( uriencode ' page[limit]' ) =10" # op: page%5Blimit%5D=10
8896
8997# #############jobs##############
9098
You can’t perform that action at this time.
0 commit comments