Last active
April 29, 2020 10:46
-
-
Save joshbode/22a2aa5836d6c1f65fe071aca37a4ba0 to your computer and use it in GitHub Desktop.
Fetch URL without curl/wget (good for Docker)
This file contains 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 shutil, sys, requests; x = requests.get(sys.argv[1], stream=True); shutil.copyfileobj(x.raw, (sys.stdout if x.ok else sys.stderr).buffer); sys.exit(not x.ok)" https://httpbin.org/get | jq . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment