495件ヒット
[1-100件を表示]
(0.129秒)
種類
- インスタンスメソッド (440)
- 文書 (44)
- ライブラリ (11)
クラス
- CSV (22)
-
CSV
:: Row (55) -
CSV
:: Table (55) -
Net
:: HTTP (132)
モジュール
-
Net
:: HTTPHeader (176)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) - [] (55)
- []= (22)
-
basic
_ auth (11) -
cgi
/ session (11) -
content
_ length (11) -
content
_ range (11) - convert (22)
- delete (33)
-
each
_ capitalized _ name (11) - fetch (33)
- field (11)
- get (22)
- get2 (22)
-
get
_ fields (11) - head (11)
- head2 (22)
-
main
_ type (11) - method (11)
-
proxy
_ basic _ auth (11) - range (11)
-
range
_ length (11) -
request
_ get (22) -
request
_ head (22) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
send
_ request (11) -
sub
_ type (11)
検索結果
先頭5件
-
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...