るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. net/http get
  2. net/http start
  3. http get
  4. http start
  5. net/http fetch

ライブラリ

モジュール

検索結果

Net::HTTPHeader#key?(key) -> bool (78340.0)

key というヘッダフィールドがあれば真を返します。 key は大文字小文字を区別しません。

key というヘッダフィールドがあれば真を返します。
key は大文字小文字を区別しません。

@param key 探すヘッダフィールド名を文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.key?('content-type') # => true
res.key?('nonexist-header') # => false
//}