るりまサーチ

最速Rubyリファレンスマニュアル検索!
356件ヒット [1-100件を表示] (0.050秒)
トップページ > クエリ:http[x] > クエリ:get[x] > クエリ:body[x]

別のキーワード

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

検索結果

<< 1 2 3 ... > >>

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

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

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

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

dest は時代遅れの引数です。利用しないでください。
dest を指定した場合に...
...][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http
.get('/~foo/', nil)...

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

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

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

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

dest は時代遅れの引数です。利用しないでください。
dest を指定した場合に...
...][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http
.get('/~foo/', nil)...

Net::HTTPResponse#body -> String | () | nil (21137.0)

エンティティボディを返します。

...す。

Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。

entity は obsolete です。

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

uri = "http://www.exampl...
...e.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}...

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

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...@param 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...
...response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

Net::HTTP#get2(path, header = nil) {|response| .... } -> Net::HTTPResponse (9288.0)

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...@param 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...
...response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

絞り込み条件を変える

Net::HTTP#request_get(path, header = nil) -> Net::HTTPResponse (9288.0)

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...@param 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...
...response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

Net::HTTP#request_get(path, header = nil) {|response| .... } -> Net::HTTPResponse (9288.0)

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...@param 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...
...response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@see Net::HTTP#get, Net::HTTPResponse#read_body...

Net::HTTPResponse#read_body {|str| .... } -> () (9204.0)

ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。

...y]{
require 'net/http'

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}

//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.c...
...file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http
.request_get(uri.path) do |response|
response.read_body do |s|...
...い。

dest は obsolete です。使わないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@param dest obsoleteな引数です。利用しないでください。

@see Net::HTTP#request_get...

Net::HTTPResponse#read_body(dest=nil) -> String|nil (9204.0)

ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。

...y]{
require 'net/http'

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}

//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.c...
...file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http
.request_get(uri.path) do |response|
response.read_body do |s|...
...い。

dest は obsolete です。使わないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@param dest obsoleteな引数です。利用しないでください。

@see Net::HTTP#request_get...

Net::HTTPGenericRequest#response_body_permitted? -> bool (9169.0)

サーバからのレスポンスにエンティティボディを含むことが許されている HTTP メソッド (GET, POST など)の場合真を返します。

...されている
HTTP
メソッド (GET, POST など)の場合真を返します。

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

uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.response_body_permitted? # => true

head = Net::HTTP::Head.new(uri.requ...
...est_uri)
head.response_body_permitted? # => false
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>