Say I am making a curl request: curl -X HEAD https://example.org -i
i want HTTP Response Code and a header field 'expires' in two different variables without making http request multiple times in my shell script.
Something like this i am currently doing,
url = " -X HEAD https://example.org -i "
httpCode = `eval curl --write-out '%{http_code} ${url}`
expiresHeader = `eval curl ${url} | grep expires`
I want to make only one http request and still be able to get the two fields.