66件ヒット
[1-66件を表示]
(0.155秒)
ライブラリ
-
net
/ http (11) - open-uri (11)
-
webrick
/ httprequest (11) -
webrick
/ httpresponse (33)
クラス
-
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPResponse (33)
モジュール
-
Net
:: HTTPHeader (11) -
OpenURI
:: Meta (11)
キーワード
- []= (11)
- charset (11)
-
content
_ type= (11)
検索結果
先頭5件
-
Net
:: HTTPHeader # content _ type -> String|nil (18220.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 (18202.0) -
リクエストの Content-Type ヘッダを文字列で返します。
リクエストの Content-Type ヘッダを文字列で返します。 -
WEBrick
:: HTTPResponse # content _ type -> String | nil (18202.0) -
Content-Type ヘッダの値を返します。
Content-Type ヘッダの値を返します。 -
WEBrick
:: HTTPResponse # content _ type=(val) (6208.0) -
Content-Type ヘッダの値をセットします。
...Content-Type ヘッダの値をセットします。
@param val Content-Type ヘッダの値を文字列で指定します。
res.content_type = "text/html"
@see WEBrick::HTTPUtils.#mime_type... -
OpenURI
:: Meta # charset -> String | nil (107.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"
}
//}... -
WEBrick
:: HTTPResponse # []=(field , val) (107.0) -
レスポンスの該当するヘッダに val を設定します。
...ヘッダに val を設定します。
@param field ヘッダ名を文字列で指定します。大文字と小文字を区別しません。
@param val ヘッダの値を指定します。to_s メソッドによって文字列に変換されます。
require 'time'
res['last-modified'] = Ti......me.now.httpdate
@see WEBrick::HTTPResponse#chunked?, WEBrick::HTTPResponse#content_length,
WEBrick::HTTPResponse#content_type...