In a jenkinsfile I call curl with:
sh "curl -X POST -i -u admin:admin https://[myhost]"
and I get output like this:
...
HTTP/1.1 204 No Content
Server: Apache-Coyote/1.1
...
I would like to take different actions based on the response code from the above call but how do I store only the response code/reply in a variable?