1044件ヒット
[1-100件を表示]
(0.109秒)
ライブラリ
-
net
/ http (588) - open-uri (12)
- optparse (144)
-
rexml
/ streamlistener (12) - uri (252)
-
webrick
/ httprequest (12) -
webrick
/ httpresponse (12) -
webrick
/ https (12)
クラス
-
Net
:: HTTPGenericRequest (96) -
Net
:: HTTPResponse (108) - OptionParser (144)
-
URI
:: Generic (240) -
URI
:: HTTP (12) -
WEBrick
:: HTTPRequest (24) -
WEBrick
:: HTTPResponse (12)
モジュール
-
Net
:: HTTPExceptions (12) -
Net
:: HTTPHeader (372) -
OpenURI
:: OpenRead (12) -
REXML
:: StreamListener (12)
キーワード
- + (12)
- - (12)
- == (12)
- [] (12)
- []= (12)
- absolute (12)
- absolute? (12)
-
basic
_ auth (12) - body (24)
- body= (12)
-
body
_ stream (12) -
body
_ stream= (12) - chunked? (12)
- code (12)
- coerce (12)
-
content
_ length (12) -
content
_ length= (12) -
content
_ range (12) -
content
_ type (12) -
content
_ type= (12) - delete (12)
- each (12)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ key (12) -
each
_ name (12) -
each
_ value (12) - entity (12)
- entitydecl (12)
- fetch (36)
-
form
_ data= (12) - fragment (12)
-
get
_ fields (12) -
http
_ version (12) - key? (12)
-
main
_ type (12) - merge (12)
- merge! (12)
- method (24)
- msg (12)
- normalize (12)
- normalize! (12)
- on (144)
- opaque (12)
- path (24)
-
proxy
_ basic _ auth (12) - query (12)
- range (12)
-
range
_ length (12) - read (12)
-
read
_ body (24) - relative? (12)
-
request
_ body _ permitted? (12) -
request
_ uri (12) - response (12)
-
response
_ body _ permitted? (12) -
route
_ from (12) -
route
_ to (12) - select (12)
-
set
_ content _ type (12) -
set
_ form _ data (12) -
sub
_ type (12) -
to
_ s (12) -
type
_ params (12) -
unparsed
_ uri (12) - userinfo= (12)
- value (12)
検索結果
先頭5件
-
WEBrick
:: HTTPRequest # parse(socket = nil) -> () (21102.0) -
指定された socket からクライアントのリクエストを読み込み、 自身のアクセサなどを適切に設定します。
指定された socket からクライアントのリクエストを読み込み、
自身のアクセサなどを適切に設定します。
@param socket クライアントに接続された IO オブジェクトを指定します。 -
Net
:: HTTPResponse # http _ version -> String (9148.0) -
サーバがサポートしている HTTP のバージョンを文字列で返します。
...サーバがサポートしている HTTP のバージョンを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.http_version # => "1.1"
//}... -
WEBrick
:: HTTPRequest # unparsed _ uri -> String (9101.0) -
リクエストの URI を文字列で返します。
リクエストの URI を文字列で返します。 -
Net
:: HTTPExceptions # response -> Net :: HTTPResponse (3125.0) -
例外の原因となったレスポンスオブジェクトを返します。
...レスポンスオブジェクトを返します。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.response # => #<Net::HTTPNotFound 404 Not Found readbody=true>
end
//}... -
Net
:: HTTPHeader # fetch(key) -> String (3079.0) -
key ヘッダフィールドを返します。
...y が存在する][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")....../http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP......::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (3079.0) -
key ヘッダフィールドを返します。
...y が存在する][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")....../http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP......::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
Net
:: HTTPHeader # fetch(key , default) -> String (3079.0) -
key ヘッダフィールドを返します。
...y が存在する][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")....../http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP......::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (3073.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... -
Net
:: HTTPResponse # read _ body(dest=nil) -> String|nil (3073.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...