Created
August 14, 2015 16:27
-
-
Save gramos/23202128c61f5f7021a5 to your computer and use it in GitHub Desktop.
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
= Net::HTTP#head | |
(from ruby core) | |
=== Implementation from HTTP | |
------------------------------------------------------------------------------ | |
head(path, initheader = nil) | |
------------------------------------------------------------------------------ | |
Gets only the header from path on the connected-to host. header is a Hash like | |
{ 'Accept' => '/', ... }. | |
This method returns a Net::HTTPResponse object. | |
This method never raises an exception. | |
response = nil | |
Net::HTTP.start('some.www.server', 80) {|http| | |
response = http.head('/index.html') | |
} | |
p response['content-type'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment