るりまサーチ

最速Rubyリファレンスマニュアル検索!
201件ヒット [1-100件を表示] (0.043秒)
トップページ > クエリ:http[x] > クエリ:attribute[x]

別のキーワード

  1. net/http get
  2. http start
  3. http get
  4. net/http start
  5. net/http fetch

検索結果

<< 1 2 3 > >>

REXML::Element#attribute(name, namespace = nil) -> REXML::Attribute | nil (18250.0)

name で指定される属性を返します。

...name で指定される属性を返します。

属性は REXML::Attribute オブジェクトの形で返します。

name は "foo:bar" のように prefix を指定することができます。

namespace で名前空間の URI を指定することで、その名前空間内で
name という...
...<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attribute("att") # => att='&lt;'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # =>...

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (9256.0)

namespace と name で特定される属性を返します。

...<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.get_attribute_ns("http://example.org/foo", "at...
...t") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...

REXML::Attributes#each_attribute {|attribute| ... } -> () (9238.0)

各属性に対しブロックを呼び出します。

...クを呼び出します。

個々の属性は REXML::Attribute オブジェクトで渡されます。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='...
...&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

REXML::Attributes#get_attribute(name) -> Attribute | nil (9226.0)

name という名前の属性を取得します。

...::Attributes#[]

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute("...
...att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

WEBrick::HTTPRequest#attributes -> Hash (9100.0)

@todo ???

@todo ???

絞り込み条件を変える

net/http (6298.0)

汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。

...データ転送プロトコル HTTP を扱うライブラリです。
実装は 2616 に基きます。

=== 使用例

==== ウェブサーバからドキュメントを得る (GET)

//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/ind...
...uire 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}

//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'uri'

url = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.start(url.host, url.port) {|http|
http
.get('/in...
....13.4 Form content types
でもそのように書かれています。

ところが、同じ HTML 4.01 Specification の
B.2.2 Ampersands in URI attribute values では、
この `&' がSGMLの文字実体参照で用いられることが指摘されており、
CGIやサーバの実装者に対し...

REXML::Attributes#delete(attribute) -> REXML::Element (3143.0)

指定した属性を取り除きます。

...り除きます。

attribute
で取り除く属性を指定します。
文字列もしくは REXML::Attribute オブジェクトを指定します

self が属する要素(REXML::Element)を返します。

@param attribute 取り除く属性(文字列もしくは REXML::Attribute オブジェク...
...o="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.delete("att") # => <a foo:att='1' bar:att='2'/>
a.attributes.delete("foo:att") # => <a bar:att='2'/>
attr = a.attributes....
...get_attribute("bar:att")
a.attributes.delete(attr) # => <a/>
//}...

REXML::Attributes#delete_all(name) -> [REXML::Attribute] (3113.0)

name という名前を持つ属性をすべて削除します。

...ml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.delete_all("att") # => [att='&lt;']
a # => <a foo:att='1' bar:a...

REXML::Attribute#namespace(arg = nil) -> String | nil (3036.0)

属性の名前空間の URI を返します。

...//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}...

REXML::Attributes#[](name) -> String | nil (3024.0)

属性名nameの属性値を返します。

...属性名nameの属性値を返します。

属性値ではなく REXML::Attribute オブジェクトが必要な場合は
REXML::Attributes#get_attribute を使ってください。

nameという属性名の属性がない場合は nil を返します。

@param name 属性名(文字列)

//emlis...
...'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS

a = doc.get_elements("/root/a").first

p a.attributes["att"] # => "<"
p a.attributes["bar:att"] # => "2"
//}...

絞り込み条件を変える

<< 1 2 3 > >>