るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.014秒)
トップページ > クエリ:response[x] > クエリ:basic[x] > 種類:ライブラリ[x]

別のキーワード

  1. response new
  2. net/http response
  3. http get_response
  4. imap add_response_handler
  5. net/http get_response

検索結果

net/http (67.0)

汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。

...-31'})
puts res.body

#例3: より細かく制御する
url = URI.parse('http://www.example.com/todo.cgi')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'jack', 'pass'
req.set_form_data({'from'=>'2005-01-01', 'to'=>'2005-03-31'})
res = Net::HTTP.new(url.host, url.port).start {|http| http.reque...
...0

response
= Net::HTTP.get_response(URI.parse(uri_str))
case response
when Net::HTTPSuccess
response

when Net::HTTPRedirection
fetch(response['location'], limit - 1)
else
response
.value
end
end

print fetch('http://www.example.org')
//}

より詳しくは Net::HTTPResponse...
...参照してください。

==== Basic 認証

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

Net::HTTP.start('www.example.com') {|http|
req = Net::HTTP::Get.new('/secret-page.html')
req.basic_auth 'account', 'password'
response
= http.request(req)
print response.body
}
//}





=== フォーム...