1392件ヒット
[1301-1392件を表示]
(0.066秒)
ライブラリ
- ビルトイン (48)
-
cgi
/ core (24) -
cgi
/ html (660) -
io
/ console (12) -
net
/ http (468) - open-uri (12)
- rake (12)
-
rdoc
/ markdown (24) -
rdoc
/ markup (24) -
rexml
/ document (48) - uri (36)
-
webrick
/ httpresponse (12)
クラス
- Array (12)
- CGI (24)
- IO (12)
- Module (24)
-
Net
:: HTTP (168) -
Net
:: HTTPGenericRequest (24) -
Net
:: HTTPResponse (48) -
RDoc
:: Markdown (24) -
RDoc
:: Markup (24) -
RDoc
:: Options (12) -
REXML
:: DocType (48) - Thread (12)
-
URI
:: Generic (36) -
WEBrick
:: HTTPResponse (12)
モジュール
-
CGI
:: Html3 (24) -
CGI
:: Html4 (24) -
CGI
:: Html4Fr (24) -
CGI
:: Html4Tr (24) -
CGI
:: HtmlExtension (564) - Kernel (12)
-
Net
:: HTTPHeader (228) -
OpenURI
:: Meta (12)
キーワード
- + (12)
- [] (12)
- []= (12)
- a (24)
-
add
_ html (12) -
add
_ special (12) - base (12)
- blockquote (24)
- body (12)
- bsearch (12)
- caption (24)
- charset (12)
- checkbox (24)
-
checkbox
_ group (24) - chunked? (12)
-
content
_ length (12) -
content
_ length= (12) -
content
_ range (12) -
content
_ type (12) -
content
_ type= (12) - delete (12)
- doctype (48)
- each (12)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ value (12) -
element
_ init (48) - entity (12)
-
external
_ id (12) - fetch (12)
-
file
_ field (24) - form (48)
- get (24)
- get2 (24)
-
get
_ fields (12) - head (12)
- head2 (24)
- header (12)
- hidden (24)
- html= (12)
- img (24)
- key? (12)
-
main
_ type (12) - merge (12)
- merge! (12)
-
multipart
_ form (48) - name (12)
- out (12)
-
password
_ field (24) - post (24)
- public (12)
-
radio
_ group (24) - range (12)
-
range
_ length (12) - raw (12)
-
read
_ body (12) - refine (12)
-
request
_ body _ permitted? (12) -
request
_ get (24) -
request
_ head (24) - reset (24)
-
response
_ body _ permitted? (12) -
scrolling
_ list (24) -
send
_ request (12) -
sub
_ type (12) - submit (24)
- system (12)
- task (12)
- template (12)
-
text
_ field (24) - textarea (24)
-
thread
_ variable _ get (12) - using (12)
- value (12)
検索結果
先頭5件
-
Net
:: HTTPHeader # each {|name , val| . . . . } -> () (107.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...一されます。
val は ", " で連結した文字列がブロックに渡されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }
# => accept-......encoding = gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => accept = */*
# => user-agent = Ruby
//}... -
Net
:: HTTPHeader # each _ header {|name , val| . . . . } -> () (107.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...一されます。
val は ", " で連結した文字列がブロックに渡されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }
# => accept-......encoding = gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => accept = */*
# => user-agent = Ruby
//}... -
Net
:: HTTPHeader # key?(key) -> bool (107.0) -
key というヘッダフィールドがあれば真を返します。 key は大文字小文字を区別しません。
...せん。
@param key 探すヘッダフィールド名を文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.key?('content-type') # => true
res.key?('nonexist-header') # => false
//}... -
Net
:: HTTPResponse # body -> String | () | nil (107.0) -
エンティティボディを返します。
...ない場合には nil を返します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require '......net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
Net
:: HTTPResponse # entity -> String | () | nil (107.0) -
エンティティボディを返します。
...ない場合には nil を返します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require '......net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
Net
:: HTTPResponse # read _ body(dest=nil) -> String|nil (107.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...い場合には nil を返します。
//emlist[例1 ブロックを与えずに一度に結果取得][ruby]{
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.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 で少しずつ読み書......クトは使わないでください。
dest は obsolete です。使わないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param dest obsoleteな引数です。利用しないでください... -
OpenURI
:: Meta # charset -> String | nil (107.0) -
対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。 文字列は小文字へと変換されています。
...ダの文字コード情報が使われます。
文字列は小文字へと変換されています。
Content-Type ヘッダがない場合は、nil を返します。ただし、ブロックが与えられている場合は、
その結果を返します。また対象となる URI のスキー......身のタイプが text である場合は、
2616 3.7.1 で定められているとおり、文字列 "iso-8859-1" を返します。
//emlist[例][ruby]{
require 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html"
p f.charset # => "iso-8859-1"
}
//}......のタイプが text である場合は、
2616 3.7.1 で定められているとおり、文字列 "iso-8859-1" を返します。
//emlist[例][ruby]{
require 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html"
p f.charset # => "iso-8859-1"
}
//}... -
WEBrick
:: HTTPResponse # content _ type=(val) (107.0) -
Content-Type ヘッダの値をセットします。
...Content-Type ヘッダの値をセットします。
@param val Content-Type ヘッダの値を文字列で指定します。
res.content_type = "text/html"
@see WEBrick::HTTPUtils.#mime_type...