60件ヒット
[1-60件を表示]
(0.103秒)
別のキーワード
ライブラリ
-
net
/ http (36) - optparse (12)
-
rexml
/ document (12)
クラス
-
Net
:: HTTP (24) -
Net
:: HTTPResponse (12) -
REXML
:: Instruction (12)
モジュール
キーワード
- getopts (12)
-
http
_ version (12) - target (12)
検索結果
先頭5件
-
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (18163.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...ist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/'......, nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (18163.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...ist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/'......, nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
OptionParser
:: Arguable # getopts(short _ opt , *long _ opt) -> Hash (6131.0) -
指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。
...オプションが引数をとる場合は直後に ":" を付けます。
@param long_opt ロングネームのオプション(--version や --bufsize=512)を文字列で指定をします。
オプションが引数をとる場合は後ろに ":" を付けます。......ブク
ラスの例外になります。
//emlist[t.rb][ruby]{
require 'optparse'
params = ARGV.getopts("ab:", "foo", "bar:", "bufsize:1024")
p params
//}
# 実行結果
$ ruby t.rb -b 1 --foo --bar xxx -- -a
{"bufsize"=>"1024", "a"=>false, "b"=>"1", "foo"=>true... -
Net
:: HTTPResponse # http _ version -> String (6126.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"
//}... -
REXML
:: Instruction # target -> String (6119.0) -
XML 処理命令のターゲットを返します。
...ットを返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # =...