るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.054秒)
トップページ > クエリ:|[x] > クエリ:-[x] > クエリ:new[x] > クエリ:content_type[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

モジュール

検索結果

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

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

...うな 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_u...
...ri)
req.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "multipart/form-data"
//}...