るりまサーチ

最速Rubyリファレンスマニュアル検索!
51件ヒット [1-51件を表示] (0.066秒)

別のキーワード

  1. net/http body
  2. httpresponse body
  3. httprequest body
  4. net/http read_body
  5. httpresponse read_body

ライブラリ

クラス

検索結果

WEBrick::HTTPResponse#to_s -> String (18214.0)

実際にクライアントに送られるデータを文字列として返します。

...文字列として返します。

require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
print res.to_s

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 08:58:49 GMT
Server:
Content-Length: 4...

ruby 1.6 feature (318.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...りました。

p "#{ "" }"

=> ruby 1.6.7 (2002-03-01) [i586-linux]
""

=> -:1: warning: bad substitution in string
ruby 1.6.7 (2002-09-12) [i586-linux]
"#{ }"

=> ruby 1.6.7 (2002-09-25) [i586-linux]
""

これは1.7...
...まり、名前解
決中にThreadが切替え可能ということです)

require 'resolv'
p Resolv.new.getaddress("www.ruby-lang.org").to_s

=> /usr/local/lib/ruby/1.6/resolv.rb:160: warning: timeout (...) interpreted as method call
/usr/local/lib/ruby/1.6/resolv.rb:55: warni...
...last_func may not be set.

差分は以下のようです。

@@ -227,10 +227,7 @@ rb_add_method(klass, mid, node, noex)
NODE *body;

if (NIL_P(klass)) klass = rb_cObject;
- if (klass == rb_cObject) {
- rb_secure(4);
- }
- if (rb_safe_leve...

NEWS for Ruby 2.5.0 (120.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...11547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展開内部の暗黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を...
...onSequence#trace_points を追加

* String
* String#-@ はフリーズされていない文字列の重複を排除します。
互換性のため、既にフリーズされている文字列には何もしません。 13077
* -"literal" (String#-@) は同じオブジェクトを...
... StringScanner#size, StringScanner#captures, StringScanner#values_at を追加 836

* uri
* Relative path operations no longer collapse consecutive slashes to a single slash. 8352

* webrick
* Server Name Indication (SNI) サポートを追加 13729
* WEBrick::HTTPResponse#send_body...

WEBrick::HTTPResponse#content_length -> Integer | nil (42.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...す。

: body String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body
のサイズが使われます。nil でないとき body の実際のサイズとこの値が同じかどうかの検証は行われません。
: body が IO...
...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

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT
Server:
Content-L...

WEBrick::HTTPResponse#content_length=(len) (42.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...す。

: body String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body
のサイズが使われます。nil でないとき body の実際のサイズとこの値が同じかどうかの検証は行われません。
: body が IO...
...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

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT
Server:
Content-L...

絞り込み条件を変える