るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.118秒)
トップページ > クエリ:r[x] > クエリ:file[x] > クラス:Net::HTTP[x] > クエリ:get[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

検索結果

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

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッ...
...param dest 利用しないでください。

1.1 互換モードの場合は、レスポンスに応じて例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。

//emlist[例][ruby]{
# net/http version 1.1
r
esponse, body = http.get(...
....html' )

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

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

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

@see Net::HTTP#request_get...

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

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッ...
...param dest 利用しないでください。

1.1 互換モードの場合は、レスポンスに応じて例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。

//emlist[例][ruby]{
# net/http version 1.1
r
esponse, body = http.get(...
....html' )

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

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

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

@see Net::HTTP#request_get...