648件ヒット
[1-100件を表示]
(0.019秒)
種類
- インスタンスメソッド (624)
- 特異メソッド (12)
- ライブラリ (12)
クラス
-
Net
:: HTTPGenericRequest (96) -
Net
:: HTTPResponse (108) -
URI
:: Generic (24)
モジュール
-
Net
:: HTTPExceptions (12) -
Net
:: HTTPHeader (372) -
OpenURI
:: OpenRead (12) - URI (12)
キーワード
- [] (12)
- []= (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)
- fetch (36)
-
form
_ data= (12) -
get
_ fields (12) -
http
_ version (12) - key? (12)
-
main
_ type (12) - method (24)
- msg (12)
- open-uri (12)
- path (12)
-
proxy
_ basic _ auth (12) - range (12)
-
range
_ length (12) - read (12)
-
read
_ body (24) -
request
_ body _ permitted? (12) - response (12)
-
response
_ body _ permitted? (12) - select (12)
-
set
_ content _ type (12) -
set
_ form _ data (12) -
sub
_ type (12) -
type
_ params (12) - value (12)
検索結果
先頭5件
-
URI
. parse(uri _ str) -> object (18113.0) -
与えられた URI から該当する URI::Generic のサブクラスのインスタンスを生成して 返します。scheme が指定されていない場合は、URI::Generic オブジェクトを返します。
...ない場合に発生します。
@raise URI::InvalidURIError パースに失敗した場合に発生します。
例:
require 'uri'
p uri = URI.parse("http://www.ruby-lang.org/")
# => #<URI::HTTP:0x201002a6 URL:http://www.ruby-lang.org/>
p uri.scheme # => "http"
p uri.host # =>... -
Net
:: HTTPHeader # fetch(key) -> String (36.0) -
key ヘッダフィールドを返します。
...い時、キーの探索に 失敗すると発生します。
//emlist[例 key のみ指定。key が存在する][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 の......定][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", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/inde... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (36.0) -
key ヘッダフィールドを返します。
...い時、キーの探索に 失敗すると発生します。
//emlist[例 key のみ指定。key が存在する][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 の......定][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", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/inde... -
Net
:: HTTPHeader # fetch(key , default) -> String (36.0) -
key ヘッダフィールドを返します。
...い時、キーの探索に 失敗すると発生します。
//emlist[例 key のみ指定。key が存在する][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 の......定][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", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/inde... -
Net
:: HTTPHeader # form _ data=(params) (24.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...ire 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}
//emlist[例 set_form_data][ruby]{
require 'net/http'
uri = URI.parse('http://www.... -
Net
:: HTTPHeader # range -> Range|nil (24.0) -
Range: ヘッダの示す範囲を Range オブジェクトで返します。
...な値][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['range'] = "bytes=1-5"
req.range # => [1..5]
//}
//emlist[例 Net::HTTPHeaderSyntaxError][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.ht... -
Net
:: HTTPHeader # set _ form _ data(params , sep = & # 39;&& # 39;) -> () (24.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...ire 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}
//emlist[例 set_form_data][ruby]{
require 'net/http'
uri = URI.parse('http://www.... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (24.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... -
Net
:: HTTPResponse # read _ body(dest=nil) -> String|nil (24.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...