るりまサーチ

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

別のキーワード

  1. openssl public_key
  2. _builtin each_key
  3. openssl public_key=
  4. dbm key
  5. _builtin key?

ライブラリ

検索結果

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

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
//}...