Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > webrick/httpresponseライブラリ > WEBrick::HTTPResponseクラス > body=
body=(val)[permalink][rdoc]クライアントに返す内容(エンティティボディ)をセットします。
自身が chunked であっても body の値はチャンク形式ではありません。
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