種類
- インスタンスメソッド (1491)
- 特異メソッド (286)
- 定数 (22)
- クラス (22)
- モジュール (11)
クラス
-
Net
:: HTTP (1095) -
Net
:: HTTPGenericRequest (88) -
Net
:: HTTPRequest (11) -
Net
:: HTTPResponse (165)
モジュール
-
Net
:: HTTPExceptions (11) -
Net
:: HTTPHeader (429)
キーワード
-
CODE
_ CLASS _ TO _ OBJ (11) -
CODE
_ TO _ OBJ (11) - HTTPHeader (11)
- HTTPMultiStatus (11)
- HTTPNonAuthoritativeInformation (11)
- Proxy (11)
- [] (11)
- []= (11)
- active? (11)
-
add
_ field (11) - address (11)
-
basic
_ auth (11) - body (22)
-
body
_ exist? (11) -
body
_ permitted? (11) -
body
_ stream (11) -
body
_ stream= (11) -
ca
_ file (11) -
ca
_ path (11) -
canonical
_ each (11) - cert (11)
-
cert
_ store (11) - chunked? (11)
- ciphers (11)
-
close
_ on _ empty _ response (11) - code (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type (11) -
content
_ type= (11) -
continue
_ timeout (11) - copy (11)
-
default
_ port (11) - delete (22)
- each (11)
-
each
_ capitalized (11) -
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ key (11) -
each
_ name (11) -
each
_ value (11) - entity (11)
- fetch (33)
- finish (11)
-
form
_ data= (11) - get (44)
- get2 (22)
-
get
_ fields (11) -
get
_ print (22) -
get
_ response (22) - head (11)
- head2 (22)
- header (11)
-
http
_ default _ port (11) -
http
_ version (11) -
https
_ default _ port (11) -
is
_ version _ 1 _ 1? (11) -
is
_ version _ 1 _ 2? (11) -
keep
_ alive _ timeout (11) -
keep
_ alive _ timeout= (11) - key (11)
- key? (11)
- length (11)
-
local
_ host (11) -
local
_ port (11) - lock (11)
-
main
_ type (11) - method (22)
- mkcol (11)
- move (11)
- msg (11)
- new (22)
-
open
_ timeout (11) - patch (22)
- path (11)
-
peer
_ cert (11) - port (11)
- post (22)
- post2 (22)
-
post
_ form (11) - propfind (11)
- proppatch (11)
- proxy? (11)
-
proxy
_ address (22) -
proxy
_ basic _ auth (11) -
proxy
_ class? (11) -
proxy
_ from _ env? (11) -
proxy
_ pass (22) -
proxy
_ port (22) -
proxy
_ uri (11) -
proxy
_ user (22) - proxyaddr (11)
- proxyport (11)
- put (11)
- put2 (22)
- range (11)
-
range
_ length (11) -
read
_ body (22) -
read
_ timeout (11) -
reader
_ header (11) - request (22)
-
request
_ body _ permitted? (11) -
request
_ get (22) -
request
_ head (22) -
request
_ post (22) -
request
_ put (22) - response (22)
-
response
_ body _ permitted? (11) -
send
_ request (11) -
set
_ content _ type (11) -
set
_ debug _ output (11) -
set
_ form _ data (11) -
set
_ range (33) - size (11)
-
ssl
_ timeout (11) -
ssl
_ version (11) - start (44)
- started? (11)
-
sub
_ type (11) - trace (11)
-
type
_ params (11) - unlock (11)
-
use
_ ssl? (11) - value (11)
-
verify
_ callback (11) -
verify
_ depth (11) -
verify
_ mode (11) -
version
_ 1 _ 1? (11) -
version
_ 1 _ 2 (11) -
version
_ 1 _ 2? (11) -
write
_ timeout (6)
検索結果
先頭5件
- Net
:: HTTPHeader # add _ field(key , val) -> () - Net
:: HTTPHeader # each _ capitalized _ name {|name| . . . . } -> () - Net
:: HTTPHeader # type _ params -> Hash - Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse - Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse
-
Net
:: HTTPHeader # add _ field(key , val) -> () (210.0) -
key ヘッダフィールドに val を追加します。
...-My-Header', 'a'
p request['X-My-Header'] #=> "a"
p request.get_fields('X-My-Header') #=> ["a"]
request.add_field 'X-My-Header', 'b'
p request['X-My-Header'] #=> "a, b"
p request.get_fields('X-My-Header') #=> ["a", "b"]
request.add_field 'X-My-Header', 'c'
p request['X-......My-Header'] #=> "a, b, c"
p request.get_fields('X-My-Header') #=> ["a", "b", "c"]
//}... -
Net
:: HTTPHeader # each _ capitalized _ name {|name| . . . . } -> () (178.0) -
保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。
...'x-my-header' -> 'X-My-Header')
して、ブロックに渡します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_capitalized_name { |key| puts key }
# => Accept-Encoding
# => Accept
# => User-A... -
Net
:: HTTPHeader # type _ params -> Hash (162.0) -
Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。
...Content-Type のパラメータを {"charset" => "iso-2022-jp"}
という形の Hash で返します。
Content-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.h......tml')
res = Net::HTTP.get_response(uri)
res.type_params # => {"charset"=>"UTF-8"}
//}... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (150.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...な body を
持ちません。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
dest は時代遅れの引数です。利用し......//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (150.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...な body を
持ちません。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
dest は時代遅れの引数です。利用し......//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=... -
Net
:: HTTP # post2(path , data , header = nil) -> Net :: HTTPResponse (150.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...をブロックに渡します。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
@param path POST先のエンティティの......{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body do |str... -
Net
:: HTTP # post2(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse (150.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...をブロックに渡します。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
@param path POST先のエンティティの......{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body do |str... -
Net
:: HTTP # request _ post(path , data , header = nil) -> Net :: HTTPResponse (150.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...をブロックに渡します。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
@param path POST先のエンティティの......{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body do |str... -
Net
:: HTTP # request _ post(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse (150.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...をブロックに渡します。
POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
@param path POST先のエンティティの......{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body do |str... -
Net
:: HTTPHeader # set _ form _ data(params , sep = & # 39;&& # 39;) -> () (144.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...ールド Content-Type: には
'application/x-www-form-urlencoded' が設定されます。
@param params HTML のフォームデータの Hash を与えます。
@param sep データのセパレータを文字列で与えます。
//emlist[例 form_data][ruby]{
require 'net/http'
uri = URI.parse......# => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}
//emlist[例 set_form_data][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.set_form_data({"q" => "ruby", "lang" => "en"}, ';') # => "application/x-www-form-urlencoded"
//}...