Say I have the following curl
call :
"curl -v --insecure -X POST -H 'Host: api.test.com' -H 'Tester #{@@test_name}' -d 'token=#{token_raw}' https://teststage.BLAHBLAH:token/terminate"
I'm trying to get the output of the curl call. Such as the 200 OK
or 404 ERROR
status.
So, if I do :
a = `curl -v --insecure -X POST -H 'Host: api.test.com' -H 'Tester #{@@test_name}' -d 'token=#{token_raw}' https://teststage.BLAHBLAH:token/terminate`
I get nothing back in a
However, if I do
puts `curl -v --insecure -X POST -H 'Host: api.test.com' -H 'Tester #{@@test_name}' -d 'token=#{token_raw}' https://teststage.BLAHBLAH:token/terminate`
Then I can see the output. How do I read it into the variable. I'd prefer an answer without any import like OPEN3, if possible.