るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.114秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

キーワード

検索結果

Net::HTTP#head(path, header = nil) -> Net::HTTPResponse (8.0)

サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。

...サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTP
Response のインスタンスを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*...
...

1.1 互換モードの場合は、レスポンスに応じて例外が発生します。

//emlist[例][ruby]{
require
'net/http'

response = nil
Net::HTTP
.start('some.www.server', 80) {|http|
response = http.head('/index.html')
}
p response['content-type']
//}

@see Net::HTTP#request_head...

Net::HTTP#local_host=(host) (8.0)

接続に用いるローカルホスト名を指定します。

...ost ホスト名、もしくはアドレスを示す文字列

//emlist[例][ruby]{
require
'net/http'

http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"

http.start do |h|
p h.get("/").body
end
//}

@see Net::HTTP#local_host=, Net::HTTP#local_port...

Net::HTTP#local_port=(port) (8.0)

接続に用いるローカルポートを設定します。

...、もしくはサービス名文字列)

//emlist[例][ruby]{
require
'net/http'

http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"

http.start do |h|
p h.get("/").body
end
//}

@see Net::HTTP#local_port=, Net::HTTP#local_host


@see Net::HTTP.new...