るりまサーチ

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

別のキーワード

  1. socket udp_server_sockets
  2. socket tcp_server_sockets
  3. socket tcp_server_loop
  4. socket udp_server_loop
  5. socket unix_server_socket

モジュール

キーワード

検索結果

<< < ... 10 11 12 >>

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

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

...'
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-Length: 2

ho...

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

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

...'
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-Length: 2

ho...

WEBrick::HTTPResponse#to_s -> String (7.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

hoge...
<< < ... 10 11 12 >>