24件ヒット
[1-24件を表示]
(0.075秒)
ライブラリ
-
net
/ http (24)
キーワード
- fetch (12)
-
type
_ params (12)
検索結果
-
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (132.0) -
key ヘッダフィールドを返します。
...ey のみ指定。key が存在する][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fet......emlist[例 key , default を指定][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", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.par......se('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 # type _ params -> Hash (108.0) -
Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。
...t-Type のパラメータを {"charset" => "iso-2022-jp"}
という形の Hash で返します。
Content-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')...