るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

...

@
param header ヘッダの名前を指定します。

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

//emlist[例][ruby]{
r
equire "csv"

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

@
see CSV::Row#field...

Net::HTTPHeader#set_content_type(type, params = {}) (15331.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...type と params から Content-Type: ヘッダフィールドの
値を設定します。

@
param type メディアタイプを文字列で指定します。
@
param params パラメータ属性をハッシュで指定します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www....
...example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_type # => nil
r
eq.content_type = 'multipart/form-data' # => "multipart/form-data"
r
eq.content_type # => "multipart/form-data"
//}...

Net::HTTPHeader#form_data=(params) (15285.0)

HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。

...HTMLのフォームのデータ params から
ヘッダフィールドとボディを設定します。

ヘッダフィールド Content-Type: には
'application/x-www-form-urlencoded' が設定されます。

@
param params HTML のフォームデータの Hash を与えます。
@
param sep デ...
...ist[例 form_data][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}

//emlist[例 set_form_data][ruby]{
r
equire 'net/http'...
...uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.set_form_data({"q" => "ruby", "lang" => "en"}, ';') # => "application/x-www-form-urlencoded"
//}...

Net::HTTPHeader#set_form_data(params, sep = &#39;&&#39;) -> () (15285.0)

HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。

...HTMLのフォームのデータ params から
ヘッダフィールドとボディを設定します。

ヘッダフィールド Content-Type: には
'application/x-www-form-urlencoded' が設定されます。

@
param params HTML のフォームデータの Hash を与えます。
@
param sep デ...
...ist[例 form_data][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}

//emlist[例 set_form_data][ruby]{
r
equire 'net/http'...
...uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.set_form_data({"q" => "ruby", "lang" => "en"}, ';') # => "application/x-www-form-urlencoded"
//}...

Net::HTTPHeader#proxy_basic_auth(account, password) -> [String] (15231.0)

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

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

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

//emlist[例][ruby]{
r
equire 'net/http'

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

絞り込み条件を変える

Net::HTTPHeader#range_length -> Integer|nil (15225.0)

Content-Range: ヘッダフィールドの表している長さを整数で返します。

...Content-Range: ヘッダフィールドの表している長さを整数で返します。

ヘッダが設定されていない場合には nil を返します。

@
raise Net::HTTPHeaderSyntaxError Content-Range: ヘッダフィールド
の値が不正である...
...発生します。


//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq['Content-Range'] = "bytes 1-500/1000"
r
eq.range_length # => 500
//}...

Net::HTTP#send_request(name, path, data = nil, header = nil) -> Net::HTTPResponse (12456.0)

HTTP リクエストをサーバに送り、そのレスポンスを Net::HTTPResponse のインスタンスとして返します。

...HTTP リクエストをサーバに送り、そのレスポンスを
Net::HTTPResponse のインスタンスとして返します。

@
param name リクエストのメソッド名を文字列で与えます。
@
param path リクエストのパスを文字列で与えます。
@
param data リクエ...
...ストのボディを文字列で与えます。
@
param header リクエストのヘッダをハッシュで与えます。

//emlist[例][ruby]{
r
esponse = http.send_request('GET', '/index.html')
puts response.body
//}

@
see Net::HTTP#request...

Net::HTTPHeader#content_length -> Integer|nil (12325.0)

Content-Length: ヘッダフィールドの表している値を整数で返します。

...Content-Length: ヘッダフィールドの表している値を整数で返します。

ヘッダが設定されていない場合には nil を返します。

@
raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。...
...//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_length # => nil
r
eq.content_length = 10
r
eq.content_length # => 10
//}...

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

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

...ドを返します。

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

該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブ...
...key は大文字小文字を区別しません。

@
param key ヘッダフィール名を文字列で与えます。
@
param default 該当するキーが登録されていない時の返り値を指定します。
@
raise IndexError 引数defaultもブロックも与えられてない時、キーの...
.../emlist[例 key のみ指定。key が存在する][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
r
equire 'net/http'

be...
<< 1 2 3 ... > >>