別のキーワード
クラス
- CSV (3)
-
CSV
:: FieldInfo (3) -
JSON
:: Parser (2) -
Net
:: HTTPGenericRequest (8) -
Net
:: HTTPResponse (9) - Object (4)
- OptionParser (48)
- String (1)
-
URI
:: MailTo (3)
モジュール
- Kernel (1)
-
Net
:: HTTPExceptions (1) -
Net
:: HTTPHeader (31) -
OptionParser
:: Arguable (7) -
REXML
:: StreamListener (1)
キーワード
- JSON (1)
- [] (1)
- []= (1)
- accept (1)
-
basic
_ auth (1) - body (2)
- body= (1)
-
body
_ stream (1) -
body
_ stream= (1) - chunked? (1)
- code (1)
-
content
_ length (1) -
content
_ length= (1) -
content
_ range (1) -
content
_ type (1) -
content
_ type= (1) - convert (3)
-
default
_ argv (1) -
default
_ argv= (1) - delete (1)
- each (1)
-
each
_ capitalized _ name (1) -
each
_ header (1) -
each
_ key (1) -
each
_ name (1) -
each
_ value (1) - entity (1)
- entitydecl (1)
- environment (1)
- fetch (3)
-
form
_ data= (1) -
get
_ fields (1) - getopts (1)
- header (1)
- headers (1)
- help (1)
-
http
_ version (1) - index (1)
- key? (1)
- line (1)
- load (1)
-
main
_ type (1) - method (2)
- msg (1)
- on (12)
-
on
_ head (1) -
on
_ tail (1) - order (4)
- order! (4)
- parse! (2)
-
parse
_ csv (1) - path (1)
- permute (2)
- permute! (2)
-
program
_ name (1) -
program
_ name= (1) -
proxy
_ basic _ auth (1) - range (1)
-
range
_ length (1) -
read
_ body (2) - reject (1)
- release (1)
-
request
_ body _ permitted? (1) - response (1)
-
response
_ body _ permitted? (1) - separator (1)
-
set
_ content _ type (1) -
set
_ form _ data (1) - source (1)
-
sub
_ type (1) - summarize (2)
-
summary
_ indent (1) -
summary
_ indent= (1) -
summary
_ width (1) -
summary
_ width= (1) - then (2)
-
to
_ a (1) -
to
_ mailtext (1) -
to
_ rfc822text (1) -
to
_ s (1) -
type
_ params (1) - value (1)
- ver (1)
-
yield
_ self (2)
検索結果
先頭5件
-
Net
:: HTTPHeader # content _ range -> Range|nil (76.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
Content-Range: ヘッダフィールドの値を Range で返します。
Range の表わす長さは 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... -
Net
:: HTTPHeader # content _ type -> String|nil (76.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 # content _ type=(type) (76.0) -
type と params から Content-Type: ヘッダフィールドの 値を設定します。
type と params から Content-Type: ヘッダフィールドの
値を設定します。
@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => ni... -
Net
:: HTTPHeader # delete(key) -> [String] | nil (76.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 # each _ capitalized _ name {|name| . . . . } -> () (76.0) -
保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。
保持しているヘッダ名を正規化
('x-my-header' -> 'X-My-Header')
して、ブロックに渡します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_capitalized_name { |key| puts key }
# => Accept-Encoding
# => Accept
# => User-Agent
//} -
Net
:: HTTPHeader # each _ key {|name| . . . } -> () (76.0) -
保持しているヘッダ名をブロックに渡して呼びだします。
保持しているヘッダ名をブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_name { |name| puts name }
# => accept-encoding
# => accept
# => user-agent
//} -
Net
:: HTTPHeader # each _ name {|name| . . . } -> () (76.0) -
保持しているヘッダ名をブロックに渡して呼びだします。
保持しているヘッダ名をブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_name { |name| puts name }
# => accept-encoding
# => accept
# => user-agent
//} -
Net
:: HTTPHeader # get _ fields(key) -> [String] (76.0) -
key ヘッダフィールドの値 (文字列) を配列で返します。
key ヘッダフィールドの値 (文字列) を配列で返します。
たとえばキー 'content-length' に対しては ['2048'] のような
文字列が得られます。一種類のヘッダフィールドが一つのヘッダの中
に複数存在することがありえます。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(ur... -
Net
:: HTTPHeader # key?(key) -> bool (76.0) -
key というヘッダフィールドがあれば真を返します。 key は大文字小文字を区別しません。
key というヘッダフィールドがあれば真を返します。
key は大文字小文字を区別しません。
@param key 探すヘッダフィールド名を文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.key?('content-type') # => true
res.key?('nonexist-header') # => false
//} -
Net
:: HTTPHeader # main _ type -> String|nil (76.0) -
"text/html" における "text" のようなタイプを表す 文字列を返します。
"text/html" における "text" のようなタイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//} -
Net
:: HTTPHeader # method -> String (76.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] (76.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 # range _ length -> Integer|nil (76.0) -
Content-Range: ヘッダフィールドの表している長さを整数で返します。
Content-Range: ヘッダフィールドの表している長さを整数で返します。
ヘッダが設定されていない場合には nil を返します。
@raise Net::HTTPHeaderSyntaxError Content-Range: ヘッダフィールド
の値が不正である場合に
発生します。
//emlist[例][ruby]{
require 'net/http'
uri = UR... -
Net
:: HTTPHeader # set _ content _ type(type , params = {}) (76.0) -
type と params から Content-Type: ヘッダフィールドの 値を設定します。
type と params から Content-Type: ヘッダフィールドの
値を設定します。
@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => ni... -
Net
:: HTTPHeader # sub _ type -> String|nil (76.0) -
"text/html" における "html" のようなサブタイプを表す 文字列を返します。
"text/html" における "html" のようなサブタイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.sub_type # => "html"
//} -
Net
:: HTTPHeader # type _ params -> Hash (76.0) -
Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。
Content-Type のパラメータを {"charset" => "iso-2022-jp"}
という形の Hash で返します。
Content-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.type_params # => {"charset"=>"UTF-8"}
//} -
Net
:: HTTPResponse # body -> String | () | nil (76.0) -
エンティティボディを返します。
エンティティボディを返します。
レスポンスにボディがない場合には nil を返します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
r... -
Net
:: HTTPResponse # code -> String (76.0) -
HTTP のリザルトコードです。例えば '302' などです。
HTTP のリザルトコードです。例えば '302' などです。
この値を見ることでレスポンスの種類を判別できますが、
レスポンスオブジェクトがどのクラスのインスタンスかを
見ることでもレスポンスの種類を判別できます。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.code # => "200"
//} -
Net
:: HTTPResponse # entity -> String | () | nil (76.0) -
エンティティボディを返します。
エンティティボディを返します。
レスポンスにボディがない場合には nil を返します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
r... -
Net
:: HTTPResponse # http _ version -> String (76.0) -
サーバがサポートしている HTTP のバージョンを文字列で返します。
サーバがサポートしている HTTP のバージョンを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.http_version # => "1.1"
//} -
Net
:: HTTPResponse # message -> String (76.0) -
HTTP サーバがリザルトコードに付加して返すメッセージです。 例えば 'Not Found' などです。
HTTP サーバがリザルトコードに付加して返すメッセージです。
例えば 'Not Found' などです。
msg は obsolete です。使わないでください。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.message # => "OK"
//} -
Net
:: HTTPResponse # msg -> String (76.0) -
HTTP サーバがリザルトコードに付加して返すメッセージです。 例えば 'Not Found' などです。
HTTP サーバがリザルトコードに付加して返すメッセージです。
例えば 'Not Found' などです。
msg は obsolete です。使わないでください。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.message # => "OK"
//}