るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

モジュール

キーワード

検索結果

Net::HTTPHeader#content_type=(type) (18107.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...

WEBrick::HTTPResponse#content_type=(val) (18107.0)

Content-Type ヘッダの値をセットします。

...Content-Type ヘッダの値をセットします。

@param val Content-Type ヘッダの値を文字列で指定します。

res.content_type = "text/html"

@see WEBrick::HTTPUtils.#mime_type...

Net::HTTPHeader#set_content_type(type, params = {}) (3007.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...

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

"text/html" のような 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"
//}...