108件ヒット
[1-100件を表示]
(0.047秒)
種類
- インスタンスメソッド (72)
- 特異メソッド (24)
- 文書 (12)
ライブラリ
-
net
/ http (36) - open-uri (24)
-
webrick
/ httpresponse (36)
クラス
モジュール
-
Net
:: HTTPHeader (36) - OpenURI (24)
キーワード
- []= (12)
-
content
_ length= (24) - delete (12)
-
open
_ uri (24) -
ruby 1
. 8 . 3 feature (12)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (18138.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実際のサイズとこの値が同じかどうかの検証は行われません。
: body が IO オブジェクトである場合
content_length の値......。nil でないとき IO から content_length バイトだけ読み込みそれを
エンティティボディとします。
また 2616 4.4 で定められた Content-Length ヘッダを送ってはいけない場合に当てはまる時には
content_length の値は無視され Content-Leng......まれません。
@param len ヘッダの値を整数で指定します。nil を指定することは出来ません。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s... -
Net
:: HTTPHeader # content _ length -> Integer|nil (18125.0) -
Content-Length: ヘッダフィールドの表している値を整数で返します。
...。
@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length #......=> nil
req.content_length = 10
req.content_length # => 10
//}... -
WEBrick
:: HTTPResponse # content _ length=(len) (6138.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実際のサイズとこの値が同じかどうかの検証は行われません。
: body が IO オブジェクトである場合
content_length の値......。nil でないとき IO から content_length バイトだけ読み込みそれを
エンティティボディとします。
また 2616 4.4 で定められた Content-Length ヘッダを送ってはいけない場合に当てはまる時には
content_length の値は無視され Content-Leng......まれません。
@param len ヘッダの値を整数で指定します。nil を指定することは出来ません。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s... -
Net
:: HTTPHeader # content _ length=(len) (6125.0) -
Content-Length: ヘッダフィールドに値を設定します。
...します。
@param len 設定する値を整数で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length = 10 # => 10
req.content_length # => 1... -
OpenURI
. open _ uri(name , mode = & # 39;r& # 39; , perm = nil , options = {}) -> StringIO (66.0) -
URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。
...シンボル、
* :proxy
* :progress_proc
* :content_length_proc
* :http_basic_authentication
* :proxy_http_basic_authentication
* :read_timeout
* :ssl_ca_cert
* :ssl_verify_mode
* :ftp_active_mode
* :redirect
です。
「:content_length_proc」と「:progress_proc」はプログレスバ......on
HTTP の Basic 認証のためのユーザ名とパスワードを、文字列の配列 ["user", "password"] として与えます。
: :content_length_proc
値にはブロックを与えます。ブロックは対象となる URI の
Content-Length ヘッダの値を引数として、実際......これで指定します。
@param name オープンしたいリソースを文字列で与えます。
@param mode モードを文字列で与えます。Kernel.#open と同じです。
@param perm 無視されます。
@param options ハッシュを与えます。
@return 返り値である... -
OpenURI
. open _ uri(name , mode = & # 39;r& # 39; , perm = nil , options = {}) {|sio| . . . } -> nil (66.0) -
URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。
...シンボル、
* :proxy
* :progress_proc
* :content_length_proc
* :http_basic_authentication
* :proxy_http_basic_authentication
* :read_timeout
* :ssl_ca_cert
* :ssl_verify_mode
* :ftp_active_mode
* :redirect
です。
「:content_length_proc」と「:progress_proc」はプログレスバ......on
HTTP の Basic 認証のためのユーザ名とパスワードを、文字列の配列 ["user", "password"] として与えます。
: :content_length_proc
値にはブロックを与えます。ブロックは対象となる URI の
Content-Length ヘッダの値を引数として、実際......これで指定します。
@param name オープンしたいリソースを文字列で与えます。
@param mode モードを文字列で与えます。Kernel.#open と同じです。
@param perm 無視されます。
@param options ハッシュを与えます。
@return 返り値である... -
Net
:: HTTPHeader # delete(key) -> [String] | nil (30.0) -
key ヘッダフィールドを削除します。
...key ヘッダフィールドを削除します。
@param key 削除するフィールド名
@return 取り除かれたフィールドの値を返します。
key ヘッダフィールドが存在しなかった場合には
nil を返します。
//emlist[例][ruby]{
require 'net/ht......tp'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length = 10
req.content_length # => 10
req.delete("Content-Length") # => ["10"]
req.content_length # => nil
//}... -
WEBrick
:: HTTPResponse # []=(field , val) (24.0) -
レスポンスの該当するヘッダに 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... -
ruby 1
. 8 . 3 feature (12.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...https での Proxy 認証をサポートするようになりました。
: Net::HTTP.post_form(url, params) [lib] [new]
: Net::HTTPHeader#content_length= [lib] [new]
: Net::HTTPHeader#content_type [lib] [new]
: Net::HTTPHeader#main_type [lib] [new]
: Net::HTTPHeader#sub_type......y-talk:144741>))
class Fred
@@foo = 99
def foo
@@foo
end
end
def Fred.foo
@@foo = 101 #=> @@foo は Fred クラスのクラス変数ではない。
end
def Fred.foo_foo
class_variable_set(:@@foo, 101) # self が Fred ク......ラス自身であることに注意。クラス変数 @@foo に値をセットする。
end
Fred.foo # メソッドを呼んでも、Fred クラスのクラス変数 @@foo は変わらない。
p Fred.new.foo #=> 99
Fred.foo_foo #
p Fred.new.foo #...