るりまサーチ

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

別のキーワード

  1. matrix index
  2. matrix find_index
  3. _builtin find_index
  4. _builtin index
  5. matrix each_with_index

ライブラリ

キーワード

検索結果

<< 1 2 > >>

Net::HTTP#get(path, header = nil, dest = nil) -> Net::HTTPResponse (19.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...呼びだされたときは
エンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の
Net::HTTP
Response オブジェクトは有効な body を
持ちません。

dest は時代遅れの引数です。利用しないでください。
dest...
...t( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#req...

Net::HTTP#get(path, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (19.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...呼びだされたときは
エンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の
Net::HTTP
Response オブジェクトは有効な body を
持ちません。

dest は時代遅れの引数です。利用しないでください。
dest...
...t( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#req...

Net::HTTP#get2(path, header = nil) -> Net::HTTPResponse (13.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...サーバ上の path にあるエンティティを取得します。
Net::HTTP
Response オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...とともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイ...
...で指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # rea...

Net::HTTP#get2(path, header = nil) {|response| .... } -> Net::HTTPResponse (13.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...サーバ上の path にあるエンティティを取得します。
Net::HTTP
Response オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...とともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイ...
...で指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # rea...

Net::HTTP#request_get(path, header = nil) -> Net::HTTPResponse (13.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...サーバ上の path にあるエンティティを取得します。
Net::HTTP
Response オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...とともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイ...
...で指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # rea...

絞り込み条件を変える

Net::HTTP#request_get(path, header = nil) {|response| .... } -> Net::HTTPResponse (13.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...サーバ上の path にあるエンティティを取得します。
Net::HTTP
Response オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...とともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイ...
...で指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # rea...

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

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

...ートを整数で指定します。
@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.get_print(uri) -> () (13.0)

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

...ートを整数で指定します。
@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 (7.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#head2(path, header = nil) -> Net::HTTPResponse (7.0)

サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。

...サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTP
Response オブジェクトを返します。

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

ブロックとともに呼び出されたときは、
Net::HTTP
#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味...
...文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。


head2 は時代遅れなので使わないでください。

//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}

@see Net::HTTP#head...

絞り込み条件を変える

<< 1 2 > >>