るりまサーチ

最速Rubyリファレンスマニュアル検索!
121件ヒット [1-100件を表示] (0.116秒)

別のキーワード

  1. string []=
  2. string slice!
  3. string slice
  4. string []
  5. string gsub!

検索結果

<< 1 2 > >>

URI::Generic#path -> String | nil (29285.0)

自身の path を文字列で返します。設定されていない場合は nil を返します。

... 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').path #=> '/foo'...

Net::HTTPGenericRequest#path -> String (18249.0)

リクエストする path を文字列で返します。

...リクエストする path を文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri
= URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//}...

WEBrick::HTTPRequest#path -> String (18219.0)

リクエスト URI のパスを表す文字列を返します。

...リクエスト URI のパスを表す文字列を返します。...

URI::HTTP#request_uri -> String (17265.0)

自身の「path + '?' + query」を文字列で返します。 query が nil である場合は、自身の path を返します。

...の「path + '?' + query」を文字列で返します。
query が nil である場合は、自身の path を返します。

path
が空である場合には、path は「'/'」であるとします。

例:
require 'uri'
u = URI.parse("http://example.com/search?q=xxx")
p u.request_uri...

Gem::RemoteFetcher#open_uri_or_path(uri, last_modified = nil, head = false, depth = 0) -> StringIO | File (12436.0)

@param uri URI を指定します。

...@param uri URI を指定します。

@param last_modified 最終更新時刻を指定します。

@param head 真を指定するとヘッダ情報のみ取得します。

@param depth 現在のリダイレクト回数を指定します。

@raise Gem::RemoteFetcher::FetchError デフォルトで...

絞り込み条件を変える

Gem::RemoteFetcher#get_file_uri_path(uri) -> String (12433.0)

与えられた URI から "file://" を取り除いた文字列を返します。

...与えられた URI から "file://" を取り除いた文字列を返します。

@param uri URI を表す文字列を指定します。...

URI::Generic#select(*components) -> [String] (11132.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"]...

Gem::RemoteFetcher#fetch_path(uri, mtime = nil, head = false) -> String | Hash (6332.0)

与えられた URI からダウンロードしたデータを文字列として返します。

...与えられた URI からダウンロードしたデータを文字列として返します。

ヘッダ情報のみ取得した場合はハッシュを返します。

@param uri データ取得先の URI を指定します。

@param mtime 更新時刻を指定します。

@param head 真を...

WEBrick::HTTPRequest#path_info -> String (6235.0)

リクエスト URI のパスを文字列で返します。デフォルトは path と同じです。

...リクエスト URI のパスを文字列で返します。デフォルトは path と同じです。...

Net::HTTPResponse#read_body(dest=nil) -> String|nil (168.0)

ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。

...et/http'

uri
= "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}

//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'

uri
= URI.parse('http://www.example.com/path/to/big...
....file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http.request_get(uri.path) do |response|
response.read_body do |s|...

絞り込み条件を変える

<< 1 2 > >>