るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.112秒)
トップページ > バージョン:2.3.0[x] > 種類:インスタンスメソッド[x] > クエリ:u[x] > クエリ:@[x] > モジュール:Net::HTTPHeader[x]

別のキーワード

  1. erb u
  2. util u
  3. matrix u
  4. _builtin koi8_u
  5. encoding koi8_u

ライブラリ

キーワード

検索結果

Net::HTTPHeader#basic_auth(account, password) -> [String] (18343.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] (18343.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::HTTPHeader#fetch(key, default) -> String (379.0)

key ヘッダフィールドを返します。

...q.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}

@see Net::HTTPHeader#[]...