- head(path, header = nil) -> Net::HTTPResponse[permalink][rdoc][edit]
- 
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。 header が nil でなければ、リクエストを送るときにその内容を HTTP ヘッダとして送ります。 header は { 'Accept' = > '*/*', ... } という形のハッシュでなければいけません。 - [PARAM] path:
- 取得するエンティティのパスを文字列で指定します。
- [PARAM] header:
- リクエストの HTTP ヘッダをハッシュで指定します。
 1.1 互換モードの場合は、レスポンスに応じて例外が発生します。 例 require 'net/http' response = nil Net::HTTP.start('some.www.server', 80) {|http| response = http.head('/index.html') } p response['content-type'][SEE_ALSO] Net::HTTP#request_head