るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.021秒)
トップページ > バージョン:2.5.0[x] > クエリ:Hash[x] > モジュール:Net::HTTPHeader[x]

別のキーワード

  1. _builtin hash
  2. hash []
  3. dbm to_hash
  4. matrix hash
  5. _builtin to_hash

ライブラリ

キーワード

検索結果

Net::HTTPHeader#type_params -> Hash (355.0)

Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。

Content-Type のパラメータを {"charset" => "iso-2022-jp"}
という形の Hash で返します。

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

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.type_params # => {"charset"=>"UTF-8"}
//}

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

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

...q.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#form_data=(params) (22.0)

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

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

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

@param params HTML のフォームデータの Hash を与えます。
@param sep データのセパレータを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Ne...

Net::HTTPHeader#set_form_data(params, sep = '&') -> () (22.0)

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

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

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

@param params HTML のフォームデータの Hash を与えます。
@param sep データのセパレータを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Ne...

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

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

...q.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, default) -> String (7.0)

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

...q.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#[]...