I use curl to get http headers to find http status code and also return response. I get the http headers with the command
curl -I http://localhost
while : ; do curl -sL -w "%{http_code} %{url_effective}\\n" http://host -o /dev/null; done