Created
April 25, 2012 14:36
-
-
Save gaurish/2490212 to your computer and use it in GitHub Desktop.
Get status of a http request in single line code
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
ruby -e "require 'open-uri'; open('http://google.com'){|response| print response.status}" | |
#["200", "OK"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment