るりまサーチ

最速Rubyリファレンスマニュアル検索!
72件ヒット [1-72件を表示] (0.107秒)
トップページ > クエリ:Ruby[x] > 種類:インスタンスメソッド[x] > クエリ:r[x] > クエリ:ruby[x] > クエリ:parse[x] > クエリ:on[x] > モジュール:Net::HTTPHeader[x]

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

検索結果

Net::HTTPHeader#content_range -> Range|nil (12320.0)

Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。

...Content-Range: ヘッダフィールドの値を Range で返します。
R
ange の表わす長さは Net::HTTPHeader#range_length で得られます。

ヘッダが設定されていない場合には nil を返します。

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

uri = URI.parse('http://www.exa...
...mple.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.content_range # => nil
r
eq['Content-Range'] = "bytes 0-499/1234"
r
eq.content_range # => 0..499
//}...

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

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

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

ヘッダが設定されていない場合には nil を返します。

@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_length # => nil
r
eq.content_length = 10
r
eq.content_length # => 10
//}...

Net::HTTPHeader#content_type -> String|nil (9220.0)

"text/html" のような Content-Type を表す 文字列を返します。

...Content-Type を表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

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

uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
r
eq = Net::HTTP::Post.new(uri.request_uri)
r
e...
...q.content_type # => nil
r
eq.content_type = 'multipart/form-data'
r
eq.content_type # => "multipart/form-data"
//}...

Net::HTTPHeader#set_content_type(type, params = {}) (9220.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...type と params から Content-Type: ヘッダフィールドの
値を設定します。

@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。

//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_type # => nil
r
eq.content_type = 'multipart/form-data' # => "multipart/form-data"
r
eq.content_type # => "multipart/form-data"
//}...

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

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

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

len に nil を与えると Content-Length: ヘッダフィールドを
削除します。

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

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

uri = URI.parse('http://www.example.com/ind...
...ex.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 # => 10
//}...

絞り込み条件を変える

Net::HTTPHeader#content_type=(type) (9120.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...type と params から Content-Type: ヘッダフィールドの
値を設定します。

@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。

//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_type # => nil
r
eq.content_type = 'multipart/form-data' # => "multipart/form-data"
r
eq.content_type # => "multipart/form-data"
//}...