るりまサーチ

最速Rubyリファレンスマニュアル検索!
144件ヒット [1-100件を表示] (0.066秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:require[x] > クエリ:r[x] > ライブラリ:webrick/httpresponse[x]

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

クラス

キーワード

検索結果

<< 1 2 > >>

WEBrick::HTTPResponse#set_redirect(status, url) -> () (9209.0)

指定された url にリダイレクトするためのヘッダと内容(エンティティボディ)を 設定し例外 status を発生させます。

...url にリダイレクトするためのヘッダと内容(エンティティボディ)を
設定し例外 status を発生させます。

@param status WEBrick::HTTPStatus::Redirect を指定します。

@param url URL を指定します。

例:
require
'webrick'
r
es.set_redirect WEBrick::H...
...TTPStatus::TemporaryRedirect...

WEBrick::HTTPResponse#http_version -> WEBrick::HTTPVersion (6209.0)

レスポンスの HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトを返します。

...ージョンを表す WEBrick::HTTPVersion オブジェクトを返します。

require
'webrick'
r
es = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
p res.http_version.class #=> WEBrick::HTTPVersion
p res.http_version.to_s...

WEBrick::HTTPResponse#reason_phrase=(val) (6109.0)

HTTP のレスポンスの最初の行の reason phrase をセットします。 この値が nil の場合 reason phrase は status から生成されます。 デフォルトは nil です。

...行の reason phrase をセットします。
この値が nil の場合 reason phrase は status から生成されます。
デフォルトは nil です。

@param val reason phrase を表す文字列を指定します。

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

p res.reason_phrase #=> "Not Found"...

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

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

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

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

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

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

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

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

: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実...
...せん。

@param len ヘッダの値を整数で指定します。nil を指定することは出来ません。

require
'webrick'
include WEBrick
r
es = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
r
es.body = f
r
es.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#cookies -> [WEBrick::Cookie] (3109.0)

レスポンスの Set-Cookie ヘッダの値を表す WEBrick::Cookie オブジェクトの配列です。 レスポンスに新たに Cookie を加えたい場合はこの配列に WEBrick::Cookie オブジェクトを加えます。

...スの Set-Cookie ヘッダの値を表す WEBrick::Cookie オブジェクトの配列です。
レスポンスに新たに Cookie を加えたい場合はこの配列に WEBrick::Cookie オブジェクトを加えます。

require
'webrick'
r
es.cookies << WEBrick::Cookie.parse_set_cookie(k)...

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

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

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

require
'webrick'
include WEBrick
r
es = HTTPResponse.new( { :HTTPVersion => "1.1" } )
r
es.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

hog...

WEBrick::HTTPResponse#[]=(field, val) (3009.0)

レスポンスの該当するヘッダに val を設定します。

...@param field ヘッダ名を文字列で指定します。大文字と小文字を区別しません。

@param val ヘッダの値を指定します。to_s メソッドによって文字列に変換されます。

require
'time'
r
es['last-modified'] = Time.now.httpdate

@see WEBrick::HTTPResp...
...onse#chunked?, WEBrick::HTTPResponse#content_length,
WEBrick::HTTPResponse#content_type...

WEBrick::HTTPResponse#body=(val) (3009.0)

クライアントに返す内容(エンティティボディ)をセットします。

...

@param val メッセージボディを文字列か IO オブジェクトで指定します。
自身が chunked であってもチャンク形式にする必要はありません。
適切にチャンク形式エンコーディングされます。

require
'webrick'
i...
...nclude WEBrick
r
es = HTTPResponse.new( { :HTTPVersion => "1.1" } )
r
es.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...
<< 1 2 > >>