るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.048秒)
トップページ > バージョン:2.1.0[x] > クエリ:String[x] > クエリ:h[x] > クエリ:main_type[x]

別のキーワード

  1. _builtin to_h
  2. struct to_h
  3. array to_h
  4. hash to_h
  5. ostruct to_h

ライブラリ

モジュール

検索結果

Net::HTTPHeader#main_type -> String|nil (63625.0)

"text/html" における "text" のようなタイプを表す 文字列を返します。

"text/html" における "text" のようなタイプを表す
文字列を返します。

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

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//}