るりまサーチ

最速Rubyリファレンスマニュアル検索!
420件ヒット [401-420件を表示] (0.063秒)
トップページ > 種類:インスタンスメソッド[x] > クラス:WEBrick::HTTPResponse[x]

ライブラリ

検索結果

<< < ... 3 4 5 >>

WEBrick::HTTPResponse#status_line -> String (2.0)

HTTP のステータスラインを CR+LF 付き文字列で返します。

...HTTP のステータスラインを CR+LF 付き文字列で返します。

require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404

p res.status_line #=> "HTTP/1.1 404 Not Found \r\n"...

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