3件ヒット
[1-3件を表示]
(0.054秒)
クラス
-
URI
:: Generic (2) -
URI
:: HTTP (1)
キーワード
-
request
_ uri (1) - select (1)
検索結果
先頭3件
-
URI
:: Generic # path -> String | nil (54505.0) -
自身の path を文字列で返します。設定されていない場合は nil を返します。
...します。
require 'uri'
p URI.parse('http://example.com/hoge').path #=> "/hoge"
p URI.parse('http://example.com').path #=> ""
p URI.parse('mailto:nospam@localhost').path #=> nil
p URI('ftp://example.com/foo').path #=> 'foo'
p URI('ftp://example.com/%2Ffoo').... -
URI
:: HTTP # request _ uri -> String (160.0) -
自身の「path + '?' + query」を文字列で返します。 query が nil である場合は、自身の path を返します。
...す。
query が nil である場合は、自身の path を返します。
path が空である場合には、path は「'/'」であるとします。
例:
require 'uri'
u = URI.parse("http://example.com/search?q=xxx")
p u.request_uri #=> "/search?q=xxx"... -
URI
:: Generic # select(*components) -> [String] (46.0) -
指定された 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"]...