curl query parameters get curl query parameters get curl curl

curl query parameters get


Your URL seems wrong :

https://10.1.1.132/rest/rm-central/v1/recovery-sets?query="volumeType EQ 'vvol'"

especially the query= part.

The quotes should be like this :

'https://10.1.1.132/rest/rm-central/v1/recovery-sets?query=foobar'

or with "double quotes"


Below CURL syntax solved my problem:

# curl -k -G -X 'GET' -H 'X-Auth-Token: 5127af39b7584d8c8897a0cad55accdc' -H 'Content-type: application/json' https://10.1.1.132/rest/rm-central/v1/recovery-sets -d "query=\"volumeType%20EQ%20'vvol'\""


Use the --data-urlencode option of curl.

var=volumeType EQ 'vvol'curl -sSLG "https://10.1.1.132/rest/rm-central/v1/recovery-sets" --data-urlencode "query=$var"