るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.041秒)
トップページ > クエリ:path[x] > クエリ:require[x] > クラス:Net::HTTP[x]

別のキーワード

  1. _builtin path
  2. pathname to_path
  3. _builtin absolute_path
  4. _builtin to_path
  5. pstore path

ライブラリ

キーワード

検索結果

Net::HTTP.get_print(host, path, port = 80) -> () (132.0)

指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。

...指定方法は URI で指定するか、
(host, path, port) で指定するかのいずれかです。

@param uri データの取得対象を URI で指定します。
@param host 接続先のホストを文字列で指定します。
@param path データの存在するパスを文字列で指定...
...ポートを整数で指定します。
@see Net::HTTP.get

=== 例

//emlist[][ruby]{
require
'net/http'
require
'uri'
Net::HTTP
.get_print URI.parse('http://www.example.com/index.html')
//}

もしくは

//emlist[][ruby]{
require
'net/http'
Net::HTTP
.get_print 'www.example.com', '/index.html'
//}...

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

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*...
...@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。

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.get_print(uri) -> () (32.0)

指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。

...指定方法は URI で指定するか、
(host, path, port) で指定するかのいずれかです。

@param uri データの取得対象を URI で指定します。
@param host 接続先のホストを文字列で指定します。
@param path データの存在するパスを文字列で指定...
...ポートを整数で指定します。
@see Net::HTTP.get

=== 例

//emlist[][ruby]{
require
'net/http'
require
'uri'
Net::HTTP
.get_print URI.parse('http://www.example.com/index.html')
//}

もしくは

//emlist[][ruby]{
require
'net/http'
Net::HTTP
.get_print 'www.example.com', '/index.html'
//}...