るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

...version 1.1
response, body = http.get( '/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.writ...
...e str
end
}
//}

@see Net::HTTP#request_get...

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

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

...version 1.1
response, body = http.get( '/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.writ...
...e str
end
}
//}

@see Net::HTTP#request_get...

String#getbyte(index) -> Integer | nil (6230.0)

index バイト目のバイトを整数で返します。

...
index
バイト目のバイトを整数で返します。

index
に負を指定すると末尾から数えた位置のバイト
を取り出します。
範囲外を指定した場合は nil を返します。

@param index バイトを取り出す位置

//emlist[例][ruby]{
s = "tester"
s.bytes...
...# => [116, 101, 115, 116, 101, 114]
s.getbyte(0) # => 116
s.getbyte(1) # => 101
s.getbyte(-1) # => 114
s.getbyte(6) # => nil
//}...

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

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

...nse = 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| # read body now
print str
end
}
//}

get
2 は時代遅れ...
...なので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

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

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

...nse = 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| # read body now
print str
end
}
//}

get
2 は時代遅れ...
...なので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

絞り込み条件を変える

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

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

...nse = 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| # read body now
print str
end
}
//}

get
2 は時代遅れ...
...なので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

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

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

...nse = 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| # read body now
print str
end
}
//}

get
2 は時代遅れ...
...なので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

Net::HTTPHeader#get_fields(key) -> [String] (6120.0)

key ヘッダフィールドの値 (文字列) を配列で返します。

...ール名を文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.get_fields('accept-ranges') # => ["none"]
//}

@see Net::HTTPHeader#[] , Net::HTTPHeader#[]=,
Net::HTTPHeader#add_field...

Net::HTTPHeader#fetch(key) -> String (37.0)

key ヘッダフィールドを返します。

...
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

//emlist[例 key のみ指定。key が存在する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.requ...
...ttp://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (37.0)

key ヘッダフィールドを返します。

...
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

//emlist[例 key のみ指定。key が存在する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.requ...
...ttp://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)...

絞り込み条件を変える

<< 1 2 3 ... > >>