種類
- インスタンスメソッド (144)
- ライブラリ (36)
- 文書 (36)
- モジュール関数 (16)
ライブラリ
-
cgi
/ core (12) -
net
/ http (36) - open-uri (64)
-
webrick
/ httprequest (12) -
webrick
/ httpresponse (36)
クラス
-
WEBrick
:: HTTPRequest (12) -
WEBrick
:: HTTPResponse (36)
モジュール
-
CGI
:: QueryExtension (12) - Kernel (16)
-
Net
:: HTTPHeader (36) -
OpenURI
:: Meta (36) -
OpenURI
:: OpenRead (12)
キーワード
- []= (12)
- cgi (12)
- charset (24)
-
content
_ type= (24) - open (16)
- open-uri (12)
- read (12)
-
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 9 feature (12) -
set
_ content _ type (12) -
webrick
/ cgi (12)
検索結果
先頭5件
-
Net
:: HTTPHeader # content _ type -> String|nil (18119.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 (18117.0) -
ENV['CONTENT_TYPE'] を返します。
...ENV['CONTENT_TYPE'] を返します。... -
OpenURI
:: Meta # content _ type -> String (18107.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 (18101.0) -
リクエストの Content-Type ヘッダを文字列で返します。
リクエストの Content-Type ヘッダを文字列で返します。 -
WEBrick
:: HTTPResponse # content _ type -> String | nil (18101.0) -
Content-Type ヘッダの値を返します。
Content-Type ヘッダの値を返します。 -
Net
:: HTTPHeader # content _ type=(type) (6120.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 # set _ content _ type(type , params = {}) (6120.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) (6107.0) -
Content-Type ヘッダの値をセットします。
...Content-Type ヘッダの値をセットします。
@param val Content-Type ヘッダの値を文字列で指定します。
res.content_type = "text/html"
@see WEBrick::HTTPUtils.#mime_type... -
cgi (18.0)
-
CGI プログラムの支援ライブラリです。
...local_path # ローカルファイルのパス
value.original_filename # 元の名前
value.content_type # content_type
//}
==== クライアントにクッキーを渡す
//emlist[][ruby]{
require "cgi"
cgi = CGI.new
for name, cookie in cgi.......gi = CGI.new
value = cgi.auth_type
//}
このような環境変数には以下のものがあります。
* AUTH_TYPE
* CONTENT_LENGTH
* CONTENT_TYPE
* GATEWAY_INTERFACE
* PATH_INFO
* PATH_TRANSLATED
* QUERY_STRING
* REMOTE_ADDR
* REMOTE_HOST
* REMOTE_IDENT
* REMOTE_USER
*...