Fixes #5061: create generic method to check http status

Please clarify:

> Headers to include in the HTTP request