Created
April 14, 2023 14:27
-
-
Save atemate/71a7c6b12fd4d8065fb5d2bba1e8cdb4 to your computer and use it in GitHub Desktop.
Check http health using python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -c "import http.client; \ | |
c = http.client.HTTPConnection('localhost:8080'); \ | |
r = c.request('GET', '/health'); \ | |
r = c.getresponse(); \ | |
assert r.status == 200, (r.status, r.reason)" | |
python -c 'import httpx; r = httpx.get("http://localhost:8080/health"); r.raise_for_status()' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment