Fixes #5061: create generic method to check http status

Could you also test for the opposite? Ie that http_check_status_headers("get", "${init.method}", "${init.existant_url}") gives an error when you "expect" 404 and vice versa ?