post image :date_long | 1 min Read

How to pass --url-query to curl

This is a nice way how to multiline query parameters when using curl

curl "https://example.cloud/drms/whatever/rest/deployrequests" \
--url-query "deployFromDate=10.06.2023" \
--url-query "deployToDate=10.06.2024" \
--url-query "showStates=Defined,Locked,Failed,Confirmed,Succeeded" \
-H "Authorization: Bearer ..."   \
-H 'Referer: https://.../history'  \
-H 'Accept: application/json, text/plain, */*'  | jq

202406101306

author image

Jan Toth

I have been in DevOps related jobs for past 6 years dealing mainly with Kubernetes in AWS and on-premise as well. I spent quite a lot …

comments powered by Disqus