6件ヒット
[1-6件を表示]
(0.179秒)
ライブラリ
-
net
/ http (1) - open-uri (1)
-
webrick
/ httprequest (1) -
webrick
/ httpresponse (3)
クラス
モジュール
-
Net
:: HTTPHeader (1) -
OpenURI
:: Meta (1)
キーワード
- []= (1)
- charset (1)
-
content
_ type= (1)
検索結果
先頭5件
-
Net
:: HTTPHeader # content _ type -> String|nil (54661.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/for... -
WEBrick
:: HTTPRequest # content _ type -> String | nil (54607.0) -
リクエストの Content-Type ヘッダを文字列で返します。
リクエストの Content-Type ヘッダを文字列で返します。 -
WEBrick
:: HTTPResponse # content _ type -> String | nil (54607.0) -
Content-Type ヘッダの値を返します。
Content-Type ヘッダの値を返します。 -
WEBrick
:: HTTPResponse # content _ type=(val) (18625.0) -
Content-Type ヘッダの値をセットします。
Content-Type ヘッダの値をセットします。
@param val Content-Type ヘッダの値を文字列で指定します。
res.content_type = "text/html"
@see WEBrick::HTTPUtils.#mime_type -
OpenURI
:: Meta # charset -> String | nil (322.0) -
対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。 文字列は小文字へと変換されています。
対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。
文字列は小文字へと変換されています。
Content-Type ヘッダがない場合は、nil を返します。ただし、ブロックが与えられている場合は、
その結果を返します。また対象となる URI のスキームが HTTP であり、自身のタイプが text である場合は、
2616 3.7.1 で定められているとおり、文字列 "iso-8859-1" を返します。
//emlist[例][ruby]{
require 'open-uri'
URI.open("http://www.ru... -
WEBrick
:: HTTPResponse # []=(field , val) (322.0) -
レスポンスの該当するヘッダに val を設定します。
レスポンスの該当するヘッダに val を設定します。
@param field ヘッダ名を文字列で指定します。大文字と小文字を区別しません。
@param val ヘッダの値を指定します。to_s メソッドによって文字列に変換されます。
require 'time'
res['last-modified'] = Time.now.httpdate
@see WEBrick::HTTPResponse#chunked?, WEBrick::HTTPResponse#content_length,
WEBrick::HTTPResponse#content_type
...