るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. integer >
  4. complex >
  5. comparable >

ライブラリ

モジュール

キーワード

検索結果

Net::HTTPHeader#content_type -> String|nil (18319.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"
//}...

WEBrick::HTTPRequest#content_type -> String | nil (18301.0)

リクエストの Content-Type ヘッダを文字列で返します。

リクエストの Content-Type ヘッダを文字列で返します。

WEBrick::HTTPResponse#content_type -> String | nil (18301.0)

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

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

Kernel.#open(name, mode = 'r', perm = nil, options = {}) -> StringIO | Tempfile | IO (3206.0)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

...クトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

name に open メソッドが定義されている場合は、*rest を引数として渡し
name.open(*rest, &block) のように name...
...ブクラスが発生します。詳しくは net/ftp
を参照して下さい。

例:

require 'open-uri'
sio = open('http://www.example.com') { |sio|
p sio.is_a?(OpenURI::Meta) # => true
p sio.content_type
puts sio.read
}

@see OpenURI.open_uri, URI.open...
...より拡張されたKernel.openでURLを開くときにwarningが表示されるようになりました。

require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
# ...
}
#=> warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

@param name...

Kernel.#open(name, mode = 'r', perm = nil, options = {}) {|ouri| ...} -> object (3206.0)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

...クトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

name に open メソッドが定義されている場合は、*rest を引数として渡し
name.open(*rest, &block) のように name...
...ブクラスが発生します。詳しくは net/ftp
を参照して下さい。

例:

require 'open-uri'
sio = open('http://www.example.com') { |sio|
p sio.is_a?(OpenURI::Meta) # => true
p sio.content_type
puts sio.read
}

@see OpenURI.open_uri, URI.open...
...より拡張されたKernel.openでURLを開くときにwarningが表示されるようになりました。

require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
# ...
}
#=> warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

@param name...

絞り込み条件を変える

OpenURI::Meta#charset -> String | nil (206.0)

対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。 文字列は小文字へと変換されています。

...ダの文字コード情報が使われます。
文字列は小文字へと変換されています。

Content-Type ヘッダがない場合は、nil を返します。ただし、ブロックが与えられている場合は、
その結果を返します。また対象となる URI のスキー...
...身のタイプが text である場合は、
2616 3.7.1 で定められているとおり、文字列 "iso-8859-1" を返します。

//emlist[例][ruby]{
require 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html"
p f.charset # => "iso-8859-1"
}
//}...
...のタイプが text である場合は、
2616 3.7.1 で定められているとおり、文字列 "iso-8859-1" を返します。

//emlist[例][ruby]{
require 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html"
p f.charset # => "iso-8859-1"
}
//}...