るりまサーチ

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

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. $-l kernel

ライブラリ

キーワード

検索結果

Net::HTTPHeader#content_type -> String|nil (9242.0)

"text/html" のような Content-Type を表す 文字列を返します。

..."text/html" のような Content-Type を表す
文字列を返します。

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

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

uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post...
....new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "multipart/form-data"
//}...

Net::HTTPHeader#main_type -> String|nil (9214.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_r...
...esponse(uri)
res.main_type # => "text"
//}...

Net::HTTPHeader#sub_type -> String|nil (9214.0)

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

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

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

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

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

Net::HTTPHeader#key?(key) -> bool (3113.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
//}...