るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. ipaddr to_i
  5. matrix i

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

CSV::Row#index(header, minimum_index = 0) -> Integer (24757.0)

与えられたヘッダの名前に対応するインデックスを返します。

...aram header ヘッダの名前を指定します。

@param minimum_index このインデックスより後で、ヘッダの名前を探します。
重複しているヘッダがある場合に便利です。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header1",...
..."header2", "header1"], [1, 2, 3])
row.index("header1") # => 0
row.index("header1", 1) # => 2
//}

@see CSV::Row#field...

Net::HTTPHeader#main_type -> String|nil (9206.0)

"text/html" における "text" のようなタイプを表す 文字列を返します。

...タイプを表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//}...

Net::HTTPHeader#each_capitalized_name {|name| .... } -> () (9138.0)

保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。

...規化
('x-my-header' -> 'X-My-Header')
して、ブロックに渡します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_capitalized_name { |key| puts key }

# => Accept-Encoding
# => Accept
# =...

Net::HTTPHeader#basic_auth(account, password) -> [String] (9106.0)

Authorization: ヘッダを BASIC 認証用にセットします。

...Authorization: ヘッダを BASIC 認証用にセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net:...
...:HTTP::Get.new(uri.request_uri)
req.basic_auth("user", "pass") # => ["Basic dXNlcjpwYXNz"]
//}...

Net::HTTPHeader#get_fields(key) -> [String] (9106.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#proxy_basic_auth(account, password) -> [String] (9106.0)

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

...thorization: ヘッダをセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.re...
...quest_uri)
req.proxy_basic_auth("account", "password") # => ["Basic YWNjb3VudDpwYXNzd29yZA=="]
//}...

cgi/session (6036.0)

CGI のセッション管理を行うライブラリ。

...CGI のセッション管理を行うライブラリ。

セッションとは、HTTP の一連のリクエストとレスポンスが属するべき
コンテクスト (状況) のことをいいます。
セッション管理には従来通り cgi ライブラリが提供する
クッキーを使...
...を得る)

name = session['name']

別な CGI でこのセッション情報を取り出すときは、このようにします。

=== 使い方 (ヘッダ出力)

ヘッダ出力は CGI#out、CGI#header を使っている限り
通常通りで構いません。
cgi/session は内部的にクッ...
...NV['SCRIPT_NAME'])}">[戻る]</a></p>
</body></html>
END
}
end
end

SessionDemo.new

=== 参考URL

* http://www.shugo.net/article/webdb2/#label:13
* http://www.modruby.net/doc/faq.ja.jis.html#label-13
* http://www.ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html...

CSV::Row#field(header_or_index, minimum_index = 0) -> object | nil (3460.0)

ヘッダの名前かインデックスで値を取得します。フィールドが見つからなかった場合は nil を返します。

...nil を返します。

@param header_or_index ヘッダの名前かインデックスを指定します。

@param minimum_index このインデックスより後で、ヘッダの名前を探します。
重複しているヘッダがある場合に便利です。

//emlist[...
...例][ruby]{
require "csv"

row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])

row.field("header1") # => "row1_1"
row.field("header2") # => "row1_2"
row["header1"] # => "row1_1"
row["header2"] # => "row1_2"
//}...

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

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

...します。

たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。

該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブロッ
...
...ise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri...
...ri)
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)
req.fetch("content-length") { |e| 99 } # => 99
//}

@see Net::HTTPHeader...

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

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

...します。

たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。

該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブロッ
...
...ise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri...
...ri)
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)
req.fetch("content-length") { |e| 99 } # => 99
//}

@see Net::HTTPHeader...

絞り込み条件を変える

<< 1 2 3 ... > >>