別のキーワード
ライブラリ
- csv (4)
- date (4)
- json (1)
-
net
/ http (21) - open-uri (1)
- optparse (49)
- psych (2)
-
rdoc
/ markdown (1) -
rdoc
/ parser (1) -
rdoc
/ parser / c (1) -
rdoc
/ parser / simple (1) -
rdoc
/ text (1) -
rexml
/ parsers / pullparser (4) -
rexml
/ parsers / sax2parser (6) -
rexml
/ streamlistener (1) -
ripper
/ filter (3) - uri (12)
-
webrick
/ https (1)
クラス
- CSV (3)
- DateTime (4)
-
Net
:: HTTPGenericRequest (3) -
Net
:: HTTPResponse (2) - OptionParser (43)
-
OptionParser
:: ParseError (4) -
Psych
:: Parser (1) -
Psych
:: ScalarScanner (1) -
RDoc
:: Markdown (1) -
RDoc
:: Options (2) -
RDoc
:: Parser (1) -
RDoc
:: Parser :: C (1) -
RDoc
:: Parser :: Simple (1) -
REXML
:: Parsers :: PullEvent (2) -
REXML
:: Parsers :: PullParser (2) -
REXML
:: Parsers :: SAX2Parser (6) -
Ripper
:: Filter (3) - String (1)
-
URI
:: Generic (10) -
URI
:: MailTo (2) -
WEBrick
:: HTTPRequest (1)
モジュール
- Kernel (1)
-
Net
:: HTTPHeader (16) -
OpenURI
:: OpenRead (1) -
OptionParser
:: Arguable (2) -
RDoc
:: Text (1) -
REXML
:: StreamListener (1)
キーワード
- + (1)
- - (1)
- == (1)
- JSON (1)
- [] (3)
- []= (1)
- accept (1)
-
basic
_ auth (1) - body= (1)
-
body
_ stream (1) -
body
_ stream= (1) - coerce (1)
-
content
_ length= (1) -
content
_ type= (1) - convert (3)
- deafen (1)
-
default
_ argv (1) -
default
_ argv= (1) - delete (1)
- entitydecl (1)
- environment (1)
- fetch (3)
-
form
_ data= (1) -
get
_ fields (1) - getopts (3)
- handler= (1)
- headers= (1)
- iso8601 (1)
- jisx0301 (1)
- key? (1)
- listen (5)
- load (1)
- merge (1)
- merge! (1)
- on (12)
-
on
_ XXX (1) -
on
_ default (1) -
on
_ head (1) -
on
_ tail (1) -
option
_ parser= (1) - order (4)
- order! (2)
- parse! (1)
-
parse
_ csv (1) -
parse
_ files _ matching (1) -
parse
_ time (1) - peek (1)
- permute (2)
- permute! (1)
-
program
_ name= (1) - progress= (1)
-
proxy
_ basic _ auth (1) - read (1)
-
read
_ body (2) - reason= (1)
- recover (1)
- reject (1)
- release= (1)
-
remove
_ private _ comments (1) - rfc3339 (1)
-
route
_ from (1) -
route
_ to (1) - select (1)
- separator (1)
-
set
_ backtrace (1) -
set
_ content _ type (1) -
set
_ form _ data (1) -
set
_ option (1) - summarize (2)
-
summary
_ indent= (1) -
summary
_ width= (1) - to= (1)
-
type
_ params (1) - unshift (1)
- userinfo= (1)
- version= (1)
- xmlschema (1)
検索結果
先頭5件
-
Net
:: HTTPGenericRequest # body _ stream=(f) (40.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
サーバに送るリクエストのエンティティボディを
IO オブジェクトなどのストリームで設定します。
f は read(size) メソッドが定義されている必要があります。
@param f エンティティボディのデータを得るストリームオブジェクトを与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') d... -
Net
:: HTTPHeader # [](key) -> String|nil (40.0) -
key ヘッダフィールドを返します。
key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
//emlist[例][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
//}
一種類のヘッダフィールドが一つのヘッダの中に複数存在する
場合にはそれを全て... -
Net
:: HTTPHeader # content _ length=(len) (40.0) -
Content-Length: ヘッダフィールドに値を設定します。
Content-Length: ヘッダフィールドに値を設定します。
len に nil を与えると Content-Length: ヘッダフィールドを
削除します。
@param len 設定する値を整数で与えます。
//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 = ... -
Net
:: HTTPHeader # delete(key) -> [String] | nil (40.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 # get _ fields(key) -> [String] (40.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 (40.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
//} -
OpenURI
:: OpenRead # read(options = {}) -> String (40.0) -
自身が表す内容を読み込んで文字列として返します。 self.open(options={}) {|io| io.read } と同じです。 このメソッドによって返される文字列は OpenURI::Meta によって extend されています。
自身が表す内容を読み込んで文字列として返します。
self.open(options={}) {|io| io.read } と同じです。
このメソッドによって返される文字列は OpenURI::Meta
によって extend されています。
@param options ハッシュを与えます。
require 'open-uri'
uri = URI.parse('http://www.example.com/')
str = uri.read
p str.is_a?(OpenURI::Meta) # => true
p str.content_type -
REXML
:: StreamListener # entitydecl(content) -> () (40.0) -
DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。
DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。
@param content 実体宣言が配列で渡されます
実体宣言の書き方によって content に渡されるデータの形式が異なります。
//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE root [
<!ENTITY % YN '"Yes"'>
<!ENTITY % YN 'Yes... -
URI
:: Generic # -(src) -> URI :: Generic (40.0) -
与えられた URI を表す src からの相対パスを返します。
与えられた URI を表す src からの相対パスを返します。
@param src 自身の相対パスを算出するための、ルートとなる Absolute URI を与えます。
例:
require 'uri'
p URI.parse('http://example.com/foo/bar.html') - 'http://example.com/'
#=> #<URI::Generic:0x20100256 URL:foo/bar.html> -
URI
:: Generic # coerce(oth) -> [URI , URI] (40.0) -
引数 oth をパースして [パース後の oth, self] の配列を返します。
引数 oth をパースして [パース後の oth, self] の配列を返します。
@param oth URI オブジェクトか文字列を指定します。
例:
require 'uri'
uri = URI.parse("http://my.example.com")
uri.coerce("http://foo.com")
# => [#<URI::HTTP:0x00000000bcb028 URL:http://foo.com/>, #<URI::HTTP:0x00000000d92178 URL:http://my.example.com>] -
URI
:: Generic # route _ from(src) -> URI :: Generic (40.0) -
与えられた URI を表す src からの相対パスを返します。
与えられた URI を表す src からの相対パスを返します。
@param src 自身の相対パスを算出するための、ルートとなる Absolute URI を与えます。
例:
require 'uri'
p URI.parse('http://example.com/foo/bar.html') - 'http://example.com/'
#=> #<URI::Generic:0x20100256 URL:foo/bar.html> -
URI
:: Generic # route _ to(dst) -> URI :: Generic (40.0) -
自身から dst への相対パスを返します。
自身から dst への相対パスを返します。
@param dst URI を文字列かURIオブジェクトで与えます。
例:
require 'uri'
p URI.parse('http://example.com/').route_to('http://example.com/foo/bar.html')
#=> #<URI::Generic:0x20100198 URL:foo/bar.html> -
URI
:: Generic # select(*components) -> [String] (40.0) -
指定された components に対応する構成要素を文字列の配列として返します。
指定された components に対応する構成要素を文字列の配列として返します。
@param components 構成要素名をシンボルで指定します。
例:
require 'uri'
uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx')
p uri.select(:userinfo, :host, :path)
# => ["myuser:mypass", "my.example.com", "/test.rbx"] -
URI
:: Generic # userinfo=(s) (40.0) -
自身の userinfo を設定します。
自身の userinfo を設定します。
@param s 自身の userinfo を "username" か "username:password" という形式の文字列、あるいは
[username, password] という形式の文字列の配列で指定します。
@raise URI::InvalidComponentError 不正な引数 s に対して発生します。
@raise URI::InvalidURIError userinfo と registry を同時に設定した場合に発生します。
例:
require 'uri'
u = URI.pars... -
URI
:: MailTo # headers=(s) (40.0) -
自身のヘッダーを文字列で設定します。
自身のヘッダーを文字列で設定します。
@param s ヘッダーを表す文字列を指定します。
@raise URI::InvalidComponentError 不正な引数 s に対して発生します。
例:
require 'uri'
m = URI.parse("mailto:nospam@example.com")
m.headers = URI.escape("subject=hello hello") -
URI
:: MailTo # to=(s) (40.0) -
自身の e-mail アドレスを文字列で設定します。
自身の e-mail アドレスを文字列で設定します。
@param s 自身の e-mail アドレスを文字列で指定します。
@raise URI::InvalidComponentError 不正な引数 s に対して発生します。
例:
require 'uri'
m = URI.parse("mailto:nospam@example.com")
m.to = "nospaaaam@example.com"
p m #=> #<URI::MailTo:0xb7bf0614 URL:mailt...