I was curious as to whether it would be possible to have an alias that allows me to just call this entire cURL except for the PrimaryKey which is input or piped to the alias?
For instance, I have to paste into terminal the following command (JSON), with the only difference being the Primary Key varying (PRIMARYKEY123):
curl 'https://example.com' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://example.com' --data-binary '{"query":"{\n getInfoById(Id: \"PRIMARYKEY123\") {\n details {\n images {\n url\n }\n }\n }\n}"}' --compressed
Would it be possible to have some sort of alias created where I can just enter the following into the command-line:
$ PRIMARYKEY123 | alias
Has anyone got any ideas on how I could achieve this or where I could start?
Thanks in advance for any help anyone can offer.
Thanks,
Stephen