168件ヒット
[1-100件を表示]
(0.024秒)
ライブラリ
-
cgi
/ core (12) -
net
/ http (72) - socket (24)
- uri (36)
-
webrick
/ httprequest (12) -
webrick
/ httpserver (12)
クラス
- Addrinfo (24)
-
Net
:: HTTP (48) -
Net
:: HTTPResponse (24) -
URI
:: Generic (36) -
WEBrick
:: HTTPRequest (12) -
WEBrick
:: HTTPServer (12)
モジュール
-
CGI
:: QueryExtension (12)
キーワード
-
connect
_ from (24) - hostname (12)
- hostname= (12)
-
local
_ host (12) -
local
_ host= (12) -
local
_ port (12) -
local
_ port= (12) -
read
_ body (24) - select (12)
-
virtual
_ host (12)
検索結果
先頭5件
-
WEBrick
:: HTTPRequest # host -> String (21118.0) -
リクエスト URI の host を文字列で返します。
...リクエスト URI の host を文字列で返します。... -
CGI
:: QueryExtension # host -> String (18134.0) -
ENV['HTTP_HOST'] を返します。
...ENV['HTTP_HOST'] を返します。... -
Net
:: HTTP # local _ host=(host) (9269.0) -
接続に用いるローカルホスト名を指定します。
...@param host ホスト名、もしくはアドレスを示す文字列
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_host=, Net::HTTP#loca... -
WEBrick
:: HTTPServer # virtual _ host(server) -> () (9130.0) -
サーバの保持しているバーチャルホストのリストに HTTP サーバ server を加えます。 クライアントからのリクエストのうち server へのものは server に委譲されるようになります。
...ーチャルホストのリストに HTTP サーバ server を加えます。
クライアントからのリクエストのうち server へのものは server に委譲されるようになります。
@param server バーチャルホストを表す WEBrick::HTTPServer オブジェクトを指定......e 'webrick'
include WEBrick
srv1 = HTTPServer.new( { :Port => 1080, :ServerName => 'hoge.example.com' } )
srv2 = HTTPServer.new( { :Port => 1080, :ServerName => 'foo.example.com' } )
srv = HTTPServer.new( { :Port => 1080 } )
srv.virtual_host(srv1)
srv.virtual_host(srv2)
srv.start... -
Net
:: HTTP # local _ host -> String | nil (9120.0) -
接続に用いるローカルホスト名を返します。
...接続に用いるローカルホスト名を返します。
nil の場合システムが適当にローカルホストを
決めます。
デフォルトは nil です。
@see Net::HTTP#local_host=, Net::HTTP#local_port... -
URI
:: Generic # hostname -> String | nil (6135.0) -
自身の hostname を文字列で返します。また、URI::Generic#host が設 定されていない場合は nil を返します。
...自身の hostname を文字列で返します。また、URI::Generic#host が設
定されていない場合は nil を返します。
このメソッドは URI::Generic#host に IPv6 アドレスが設定されていた
場合はブラケットを削除した文字列を返しますがそれ以......外は同じ文字列を返し
ます。
require 'uri'
u = URI("http://[::1]/bar")
p u.hostname # => "::1"
p u.host # => "[::1]"... -
URI
:: Generic # hostname=(s) (6131.0) -
自身の hostname を設定します。
...自身の hostname を設定します。
このメソッドは引数に IPv6 アドレスを設定した場合は
URI::Generic#host にブラケットを追加した文字列を設定しますがそれ
以外は同じ処理を行います。
require 'uri'
u = URI("http://foo/bar")
p u.to_s......# => "http://foo/bar"
u.hostname = "::1"
p u.to_s # => "http://[::1]/bar"
@param s 自身の hostname を表す文字列を指定します。
@raise URI::InvalidComponentError 不正な引数 s に対して発生します。
@raise URI::InvalidURIError host と registr... -
Net
:: HTTP # local _ port=(port) (3067.0) -
接続に用いるローカルポートを設定します。
...、もしくはサービス名文字列)
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_port=, Net::HTTP#local_host
@see Net::HTTP.new... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (3067.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...y]{
require 'net/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.c......om/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_b......い。
dest は obsolete です。使わないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param dest obsoleteな引数です。利用しないでください。
@see Net::HTTP#request_get...