るりまサーチ

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

別のキーワード

  1. rss content
  2. rss content=
  3. net/imap content_id
  4. items content
  5. source content=

ライブラリ

モジュール

キーワード

検索結果

Net::HTTPHeader#content_type -> String|nil (24501.0)

"text/html" のような Content-Type を表す 文字列を返します。

...ような 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.reques...
...t_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "multipart/form-data"
//}...

ruby 1.9 feature (5496.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...ルのフォーマット変更
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど(互換性のある変更) (only backward-compatibility) (影響の範囲が小さいと思われる変更もこち...
...((<ruby-list:40865>))

=== 2005-06-08
: Array#nitems [compat]

Array#nitems にブロックを渡せるようになり、ブロックが真になる要素の個数を返すように
なりました。

[1,2,3].nitems{|i| i % 2 != 0} #=> 2

((<ruby-talk:134083>))

=== 2005-06-02
: proc...
...[new]
オプション :DoNotReverseLookup 追加。

=== 2004-03-10

: ((<組み込み変数/$-W>)) [ruby] [new]
追加

=== 2004-03-07
: Net::HTTPHeader#add_header [lib] [new]
: Net::HTTPHeader#get_fields [lib] [new]
: Net::HTTPHeader#content_length= [lib] [new]
: Net::HTTPHeader#content...

ruby 1.8.3 feature (4956.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...* [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更...
...05-09-13
: Logger#formatter [lib] [new]
: Logger#formatter= [lib] [new]
: Logger::Formatter [lib] [new]

追加。

=== 2005-09-13
: Net::HTTP

https での Proxy 認証をサポートするようになりました。

: Net::HTTP.post_form(url, params) [lib] [new]

: Net::HTTPHeader#content_l...
...[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]

: Ne...

cgi (246.0)

CGI プログラムの支援ライブラリです。

...

* https://tools.ietf.org/html/draft-coar-cgi-v11-03
* 3875: The Common Gateway Interface (CGI) Version 1.1
* https://www.w3.org/CGI/

=== 使用例

==== フォームフィールドの値を得る

//emlist[][ruby]{
require "cgi"
cgi = CGI.new
values = cgi['field_name'] # <== 'field_nam...
...イルのパス
value.original_filename # 元の名前
value.content_type # content_type
//}



==== クライアントにクッキーを渡す

//emlist[][ruby]{
require "cgi"
cgi = CGI.new
for name, cookie in cgi.cookies
cookie.expires = Time.now + 30
end
cgi.out...
...#auth_type が対応します。

//emlist[][ruby]{
require "cgi"
cgi = CGI.new
value = cgi.auth_type
//}

このような環境変数には以下のものがあります。

* AUTH_TYPE
* CONTENT_LENGTH
* CONTENT_TYPE
* GATEWAY_INTERFACE
* PATH_INFO
* PATH_TRANSLATED
* QUERY_STRING...

webrick/cgi (102.0)

一般の CGI 環境で webrick ライブラリのサーブレットと同じように CGI スクリプトを書くための ライブラリです。サーバが WEBrick でなくても使うことが出来ます。

...r/local/bin/ruby
require 'webrick/cgi'

class MyCGI < WEBrick::CGI
def do_GET(req, res)
res["content-type"] = "text/plain"
ret = "hoge\n"
res.body = ret
end
end

MyCGI.new.start()

==== do_XXX メソッド

do_XXX メソッドの XXX には GET, HEAD, POST, PUT, DELETE, OPT...
...end
end
MyCGI.new.start()

==== クライアントからクッキーを得る

require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
req.cookies #=> WEBrick::Cookie オブジェクトの配列
c = req.cookies.find{|c| c.name == "name...
...class MyCGI < WEBrick::CGI
def do_GET(req, res)
req.content_length
req.content_type
req.path_info
req.query_string
req.peeraddr
req.host
req.user
req.request_method
req.script_name
req.port
end
end
MyCGI.new.start()

=== リンク

* 3875...

絞り込み条件を変える