るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n=
  3. openssl n
  4. rsa n
  5. openssl n=

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Net::HTTP#get(path, header = nil, dest = nil) -> Net::HTTPResponse (21453.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...の path にあるエンティティを取得し、
N
et::HTTPResponse のインスタンスとして返します。

header
nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッ...
...びだされたときは
エンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の
N
et::HTTPResponse オブジェクトは有効な body を
持ちません。

dest は時代遅れの引数です。利用しないでください。
dest を...
...「dest << ボディの断片」を実行します。

@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。

1.1 互換モードの場合...

Net::HTTP#get(path, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (21453.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...の path にあるエンティティを取得し、
N
et::HTTPResponse のインスタンスとして返します。

header
nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッ...
...びだされたときは
エンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の
N
et::HTTPResponse オブジェクトは有効な body を
持ちません。

dest は時代遅れの引数です。利用しないでください。
dest を...
...「dest << ボディの断片」を実行します。

@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。

1.1 互換モードの場合...

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

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

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

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

@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
//}...

Net::HTTPHeader#get_fields(key) -> [String] (12214.0)

key ヘッダフィールドの値 (文字列) を配列で返します。

...key ヘッダフィールドの値 (文字列) を配列で返します。

たとえばキー 'content-length' に対しては ['2048'] のような
文字列が得られます。一種類のヘッダフィールドが一つのヘッダの中
に複数存在することがありえます。
key は...
...ール名を文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.get_fields('accept-ranges') # => ["none"]
//}

@see Net::HTTPHeader#[] , Net::HTTPHeader#[]=,
N
et::HTTPHeader#add_field...

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

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

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

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

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

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

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

絞り込み条件を変える

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

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

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

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

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

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

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

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

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

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

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

uri = URI.parse('http://www.example.com/index.h...
...tml')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...

Net::HTTPHeader#range_length -> Integer|nil (12207.0)

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

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

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

@raise Net::HTTPHeaderSyntaxError Content-Range: ヘッダフィールド
の値が不正である...
...発生します。


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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['Content-Range'] = "bytes 1-500/1000"
req.range_length # => 500
//}...

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

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

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

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

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

uri = URI.parse('http://www.example.com/index.h...
...tml')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...

Net::HTTP#get2(path, header = nil) -> Net::HTTPResponse (9351.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...の path にあるエンティティを取得します。
N
et::HTTPResponse オブジェクトを返します。

header
nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシ...
...ともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズ...
... header リクエストの HTTP ヘッダをハッシュで指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p respon...

絞り込み条件を変える

<< 1 2 3 ... > >>