るりまサーチ

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

別のキーワード

  1. net/http get
  2. http start
  3. http get
  4. net/http start
  5. net/http set_range

ライブラリ

モジュール

検索結果

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

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

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

//emlist[例][ruby]{
require 'net/http'

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