9件ヒット
[1-9件を表示]
(0.070秒)
ライブラリ
-
net
/ http (9)
キーワード
- [] (1)
-
basic
_ auth (1) -
content
_ type (1) - delete (1)
- fetch (3)
- method (1)
-
proxy
_ basic _ auth (1)
検索結果
先頭5件
-
Net
:: HTTPHeader # fetch(key) -> String (367.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#[]... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (367.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#[]... -
Net
:: HTTPHeader # fetch(key , default) -> String (367.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#[]... -
Net
:: HTTPHeader # [](key) -> String|nil (325.0) -
key ヘッダフィールドを返します。
...存在する
場合にはそれを全て ", " で連結した文字列を返します。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
@see Net::HTTPHeader#[]=,
Net::HTTPHeader#add_field,
Net::HTTPHeader#get_fields... -
Net
:: HTTPHeader # basic _ auth(account , password) -> [String] (325.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 # content _ type -> String|nil (325.0) -
"text/html" のような Content-Type を表す 文字列を返します。
"text/html" のような Content-Type を表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/for... -
Net
:: HTTPHeader # delete(key) -> [String] | nil (325.0) -
key ヘッダフィールドを削除します。
key ヘッダフィールドを削除します。
@param key 削除するフィールド名
@return 取り除かれたフィールドの値を返します。
key ヘッダフィールドが存在しなかった場合には
nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length = 10
req.content_length... -
Net
:: HTTPHeader # method -> String (325.0) -
リクエストの HTTP メソッドを文字列で返します。
リクエストの HTTP メソッドを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//} -
Net
:: HTTPHeader # proxy _ basic _ auth(account , password) -> [String] (325.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...