るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. tracer set_get_line_procs
  2. webrick/httpservlet do_get
  3. net/http get
  4. http get
  5. http get_print

ライブラリ

モジュール

キーワード

検索結果

Net::HTTPHeader#basic_auth(account, password) -> [String] (63394.0)

Authorization: ヘッダを BASIC 認証用にセットします。

Authorization: ヘッダを BASIC 認証用にセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.basic_auth("user", "pass") # => ["Basic dXNlcjpwYXNz"]
//}...

Net::HTTPHeader#proxy_basic_auth(account, password) -> [String] (27394.0)

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

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

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.proxy_basic_auth("account", "password") # => ["Ba...

net/http (19057.0)

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

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

=== 使用例

==== ウェブサーバからドキュメントを得る (GET)

//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}

//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://w...