120件ヒット
[101-120件を表示]
(0.046秒)
別のキーワード
モジュール
- Kernel (24)
キーワード
-
check
_ signedness (24) - get (24)
- get2 (24)
- post (12)
-
request
_ get (24)
検索結果
先頭2件
-
Net
:: HTTP # request _ get(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (6107.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...onse = 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
}
//}
get2 は時代遅れ......なので使わないでください。
@see Net::HTTP#get, Net::HTTPResponse#read_body... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (107.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=subject&target=ruby') do |str|
f.write s...