I am trying to pass a variable to curl command in Perl script. But it is failing.
But when I run the same curl command from command prompt it is working.
my $id=3;
system('curl -D- -u username:password -X PUT --data {\"fields\":{\"priority\":{\"id\":\"${id}\"}}} -H "Content-Type: application/json" -k https:request);
When I execute above Perl script I am getting error as below.
{"errorMessages":[],"errors":{"priority":"The priority selected is invalid."}}after curl command
When I run the above command from command prompt by replacing id with value it is passing.
'curl -D- -u username:password -X PUT --data {\"fields\":{\"priority\":{\"id\":\"3 \"}}} -H "Content-Type: application/json" -k https:request
Please help me here and let me know what is wrong in my code.