I have the following simple function, script and I would like to set variable $1 or anyother one inside the following:
curl --request POST \
--url 'https://api.securitytrails.com/v1/domains/list?include_ips=false&scroll=false' \
--header 'APIKEY: XXX' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"whois_organization": "$1"
}
}
'
I tried couple solutions in StackExchange related to inserting variable inside single quotes by using double quotes + escapes but did not work, I know that inside single quotes everything is preserved literally but the variable is inside JSON value have double quotes, I thought since double quotes exists then it will take the first argument of the script, function.
Any thoughts of solving this so I can pass the first argument in the script to the sent request ?