374件ヒット
[1-100件を表示]
(0.073秒)
別のキーワード
ライブラリ
-
net
/ http (374)
キーワード
- [] (11)
-
add
_ field (11) -
basic
_ auth (11) -
canonical
_ each (11) - chunked? (11)
-
content
_ length (11) -
content
_ range (11) -
content
_ type (11) - delete (11)
- each (11)
-
each
_ capitalized (11) -
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ key (11) -
each
_ name (11) -
each
_ value (11) - fetch (33)
-
get
_ fields (11) - key? (11)
- length (11)
-
main
_ type (11) - method (11)
-
proxy
_ basic _ auth (11) - range (11)
-
range
_ length (11) -
set
_ form _ data (11) -
set
_ range (33) - size (11)
-
sub
_ type (11) -
type
_ params (11)
検索結果
先頭5件
-
Net
:: HTTPHeader # [](key) -> String|nil (102.0) -
key ヘッダフィールドを返します。
...t[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['user-agent'] # => Ruby
//}
一種類のヘッダフィールドが一つのヘッダの中に複数存在する
場合にはそれを全て ", " で連結した文......字列を返します。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
@see Net::HTTPHeader#[]=,
Net::HTTPHeader#add_field,
Net::HTTPHeader#get_fields... -
Net
:: HTTPHeader # add _ field(key , val) -> () (102.0) -
key ヘッダフィールドに val を追加します。
...する文字列を与えます。
@see Net::HTTPHeader#[] , Net::HTTPHeader#[]=,
Net::HTTPHeader#get_fields
//emlist[例][ruby]{
request.add_field 'X-My-Header', 'a'
p request['X-My-Header'] #=> "a"
p request.get_fields('X-My-Header') #=> ["a"]
request.add_field 'X-My-Header', '......b'
p request['X-My-Header'] #=> "a, b"
p request.get_fields('X-My-Header') #=> ["a", "b"]
request.add_field 'X-My-Header', 'c'
p request['X-My-Header'] #=> "a, b, c"
p request.get_fields('X-My-Header') #=> ["a", "b", "c"]
//}... -
Net
:: HTTPHeader # basic _ auth(account , password) -> [String] (102.0) -
Authorization: ヘッダを BASIC 認証用にセットします。
...ト名を文字列で与えます。
@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 # canonical _ each {|name , value| . . . . } -> () (102.0) -
ヘッダフィールドの正規化名とその値のペアを ブロックに渡し、呼びだします。
ヘッダフィールドの正規化名とその値のペアを
ブロックに渡し、呼びだします。
正規化名は name に対し
name.downcase.split(/-/).capitalize.join('-')
で求まる文字列です。 -
Net
:: HTTPHeader # chunked? -> bool (102.0) -
Transfer-Encoding: ヘッダフィールドが "chunked" である 場合に真を返します。
...ったり、
"chunked" 以外である場合には偽を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.chunked? # => false
req["Transfer-Encoding"] = "chunked"
req.chunked? # => true
//}... -
Net
:: HTTPHeader # content _ length -> Integer|nil (102.0) -
Content-Length: ヘッダフィールドの表している値を整数で返します。
...raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。
//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 # => nil......req.content_length = 10
req.content_length # => 10
//}... -
Net
:: HTTPHeader # content _ range -> Range|nil (102.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
...さは Net::HTTPHeader#range_length で得られます。
ヘッダが設定されていない場合には 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_range # => nil......req['Content-Range'] = "bytes 0-499/1234"
req.content_range # => 0..499
//}... -
Net
:: HTTPHeader # content _ type -> String|nil (102.0) -
"text/html" のような 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/form-data'
req.content_type # => "multipart/form-data"
//}... -
Net
:: HTTPHeader # delete(key) -> [String] | nil (102.0) -
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 # => 10
req.delete("Content-Length") # => ["10"]
req.content_length # => nil
//}... -
Net
:: HTTPHeader # each {|name , val| . . . . } -> () (102.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...mlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }
# => accept-encoding = gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => accept = */*
# => user-agent = Ruby
//}...