種類
- インスタンスメソッド (88)
- 文書 (33)
- ライブラリ (22)
- モジュール関数 (8)
ライブラリ
-
cgi
/ core (11) -
net
/ http (11) - open-uri (52)
-
webrick
/ httprequest (11) -
webrick
/ httpresponse (11)
クラス
-
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPResponse (11)
モジュール
-
CGI
:: QueryExtension (11) - Kernel (8)
-
Net
:: HTTPHeader (11) -
OpenURI
:: Meta (33) -
OpenURI
:: OpenRead (11)
キーワード
- cgi (11)
- charset (22)
- open (8)
- read (11)
-
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 9 feature (11) -
webrick
/ cgi (11)
検索結果
先頭5件
-
Net
:: HTTPHeader # content _ type -> String|nil (18220.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"
//}... -
CGI
:: QueryExtension # content _ type -> String (18218.0) -
ENV['CONTENT_TYPE'] を返します。
...ENV['CONTENT_TYPE'] を返します。... -
OpenURI
:: Meta # content _ type -> String (18208.0) -
対象となるリソースの Content-Type を文字列で返します。Content-Type ヘッダの情報が使われます。 Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
...Type を文字列で返します。Content-Type ヘッダの情報が使われます。
Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
//emlist[例][ruby]{
require 'open-uri'
open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "text/html"
}
//}......を文字列で返します。Content-Type ヘッダの情報が使われます。
Content-Type ヘッダがない場合は、"application/octet-stream" を返します。
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://www.ruby-lang.org/') {|f|
p f.content_type #=> "text/html"
}
//}... -
WEBrick
:: HTTPRequest # content _ type -> String | nil (18202.0) -
リクエストの Content-Type ヘッダを文字列で返します。
リクエストの Content-Type ヘッダを文字列で返します。 -
WEBrick
:: HTTPResponse # content _ type -> String | nil (18202.0) -
Content-Type ヘッダの値を返します。
Content-Type ヘッダの値を返します。 -
ruby 1
. 9 feature (120.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...け取るようになりました [compat]
: String#unpack("M") で CRLF を単独の LF と同様に無視するようになりました ((<ruby-dev:28601>)) [compat]
* M17N
: 以下、ここでいう「1文字」は 1byte のことです
: String#ord という、1文字の文字列に対......されました
: string[integer] が 1文字の String を返すようになりました
: string.slice(integer) が 1文字の String を返すようになりました
: ?c が 1文字の String を返すようになりました
: sprintf の %c が 1文字の String を受け付けるよ......length= [lib] [new]
: Net::HTTPHeader#content_type [lib] [new]
: Net::HTTPHeader#main_type [lib] [new]
: Net::HTTPHeader#sub_type [lib] [new]
: Net::HTTPHeader#type_params [lib] [new]
: Net::HTTPHeader#content_type= [lib] [new]
: Net::HTTPHeader#set_content_type [lib] [new]
: Net::HTTPRequest#body(... -
OpenURI
:: Meta # charset -> String | nil (108.0) -
対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。 文字列は小文字へと変換されています。
...身のタイプが 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"
}
//}... -
OpenURI
:: Meta # charset { . . . } -> String (108.0) -
対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。 文字列は小文字へと変換されています。
...身のタイプが 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"
}
//}... -
OpenURI
:: OpenRead # read(options = {}) -> String (107.0) -
自身が表す内容を読み込んで文字列として返します。 self.open(options={}) {|io| io.read } と同じです。 このメソッドによって返される文字列は OpenURI::Meta によって extend されています。
...のメソッドによって返される文字列は OpenURI::Meta
によって extend されています。
@param options ハッシュを与えます。
require 'open-uri'
uri = URI.parse('http://www.example.com/')
str = uri.read
p str.is_a?(OpenURI::Meta) # => true
p str.content_type... -
Kernel
. # open(name , mode = & # 39;r& # 39; , perm = nil , options = {}) -> StringIO | Tempfile | IO (106.0) -
name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
...name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
name......えた場合は上の場合と同様、name が http:// や ftp:// で
始まっている文字列なら URI のリソースを取得した上で StringIO オブジェクト
または Tempfile オブジェクトを引数としてブロックを評価します。後は同様です。
引数のオブ......ブクラスが発生します。詳しくは 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...