るりまサーチ

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

別のキーワード

  1. rss content=
  2. rss content
  3. net/imap content_id
  4. item content=
  5. items content=

ライブラリ

クラス

モジュール

キーワード

検索結果

Net::HTTPHeader#content_length=(len) (21107.0)

Content-Length: ヘッダフィールドに値を設定します。

...削除します。

@param len 設定する値を整数で与えます。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_length # => nil
r
eq.content_length = 10 # => 10
r
eq.content_length...

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

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

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

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

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

r
equire '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...

Net::HTTPHeader#content_length -> Integer|nil (3107.0)

Content-Length: ヘッダフィールドの表している値を整数で返します。

...ます。

@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_leng...
...th # => nil
r
eq.content_length = 10
r
eq.content_length # => 10
//}...

Net::HTTPHeader#delete(key) -> [String] | nil (3107.0)

key ヘッダフィールドを削除します。

...します。

@param key 削除するフィールド名
@return 取り除かれたフィールドの値を返します。
key ヘッダフィールドが存在しなかった場合には
nil を返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.exam...
...ple.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_length = 10
r
eq.content_length # => 10
r
eq.delete("Content-Length") # => ["10"]
r
eq.content_length # => nil
//}...

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

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

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

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

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

r
equire '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...

絞り込み条件を変える