ライブラリ
- ビルトイン (1)
-
cgi
/ core (5) -
net
/ http (36) -
net
/ imap (15) - open-uri (6)
-
rdoc
/ markup (1) -
rdoc
/ markup / formatter (1) -
rexml
/ document (4) -
rexml
/ sax2listener (4) -
rexml
/ streamlistener (6) - rss (20)
-
rubygems
/ package / tar _ output (1) -
webrick
/ httprequest (3) -
webrick
/ httpresponse (7) -
webrick
/ httpservlet / filehandler (2) -
webrick
/ httputils (1)
クラス
- CGI (3)
-
Gem
:: Package :: TarOutput (1) - IO (1)
-
Net
:: HTTP (15) -
Net
:: HTTPGenericRequest (2) -
Net
:: IMAP :: BodyTypeBasic (4) -
Net
:: IMAP :: BodyTypeMessage (4) -
Net
:: IMAP :: BodyTypeMultipart (1) -
Net
:: IMAP :: BodyTypeText (4) -
Net
:: IMAP :: ContentDisposition (2) -
RDoc
:: Markup (1) -
RDoc
:: Markup :: Formatter (1) -
REXML
:: Instruction (4) -
RSS
:: Maker :: ChannelBase :: CategoriesBase :: CategoryBase (2) -
RSS
:: Maker :: ChannelBase :: SkipDaysBase :: DayBase (2) -
RSS
:: Maker :: ChannelBase :: SkipHoursBase :: HourBase (2) -
RSS
:: Maker :: RSS20 :: Items :: Item :: Guid (2) -
RSS
:: Maker :: RSS20 :: Items :: Item :: Source (2) -
RSS
:: Rss :: Channel :: Item :: Category (2) -
RSS
:: Rss :: Channel :: Item :: Source (2) -
RSS
:: TrackBackModel20 :: TrackBackAbout (2) -
RSS
:: TrackBackModel20 :: TrackBackPing (2) -
WEBrick
:: HTTPRequest (3) -
WEBrick
:: HTTPResponse (7) -
WEBrick
:: HTTPServlet :: DefaultFileHandler (2) -
WEBrick
:: HTTPUtils :: FormData (1)
モジュール
-
CGI
:: QueryExtension (2) -
Net
:: HTTPHeader (19) -
OpenURI
:: Meta (5) -
OpenURI
:: OpenRead (1) -
REXML
:: SAX2Listener (4) -
REXML
:: StreamListener (6) -
RSS
:: ContentModel (2)
キーワード
- == (1)
- [] (2)
- []= (1)
-
add
_ gem _ contents (1) - attlistdecl (2)
- body= (1)
-
body
_ stream (1) -
body
_ stream= (1) - cdata (2)
- charset (2)
- content= (10)
-
content
_ encoded (1) -
content
_ encoded= (1) -
content
_ encoding (1) -
content
_ id (3) -
content
_ length (4) -
content
_ length= (2) -
content
_ range (1) -
content
_ type (5) -
content
_ type= (2) - convert (1)
- delete (1)
- description (3)
- disposition (4)
-
dsp
_ type (1) - elementdecl (2)
- encoding (3)
- entity (1)
- entitydecl (2)
- fetch (3)
-
form
_ data= (1) - get2 (2)
-
get
_ fields (1) - head (1)
- head2 (2)
- header (1)
- key? (1)
-
main
_ type (1) -
make
_ partial _ content (1) - notationdecl (1)
- out (1)
- param (1)
- post (2)
- post2 (2)
-
prepare
_ range (1) - print (1)
- query (1)
-
range
_ length (1) - read (1)
- readpartial (1)
-
request
_ get (2) -
request
_ head (2) -
request
_ post (2) -
set
_ content _ type (1) -
set
_ form _ data (1) -
sub
_ type (1) - target (1)
-
to
_ s (1) -
type
_ params (1)
検索結果
先頭5件
-
Net
:: HTTPHeader # form _ data=(params) (22.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
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('http://www.example.com/index.html')
req = Ne... -
Net
:: HTTPHeader # get _ fields(key) -> [String] (22.0) -
key ヘッダフィールドの値 (文字列) を配列で返します。
key ヘッダフィールドの値 (文字列) を配列で返します。
たとえばキー 'content-length' に対しては ['2048'] のような
文字列が得られます。一種類のヘッダフィールドが一つのヘッダの中
に複数存在することがありえます。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(ur... -
Net
:: HTTPHeader # key?(key) -> bool (22.0) -
key というヘッダフィールドがあれば真を返します。 key は大文字小文字を区別しません。
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
:: HTTPHeader # main _ type -> String|nil (22.0) -
"text/html" における "text" のようなタイプを表す 文字列を返します。
"text/html" における "text" のようなタイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//} -
Net
:: HTTPHeader # set _ form _ data(params , sep = & # 39;&& # 39;) -> () (22.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
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('http://www.example.com/index.html')
req = Ne... -
Net
:: HTTPHeader # sub _ type -> String|nil (22.0) -
"text/html" における "html" のようなサブタイプを表す 文字列を返します。
"text/html" における "html" のようなサブタイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.sub_type # => "html"
//} -
OpenURI
:: Meta # meta -> Hash (22.0) -
ヘッダを収録したハッシュを返します。
ヘッダを収録したハッシュを返します。
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "tran... -
OpenURI
:: OpenRead # read(options = {}) -> String (22.0) -
自身が表す内容を読み込んで文字列として返します。 self.open(options={}) {|io| io.read } と同じです。 このメソッドによって返される文字列は OpenURI::Meta によって extend されています。
自身が表す内容を読み込んで文字列として返します。
self.open(options={}) {|io| io.read } と同じです。
このメソッドによって返される文字列は OpenURI::Meta
によって extend されています。
@param options ハッシュを与えます。
require 'open-uri'
uri = URI.parse('http://www.example.com/')
str = uri.read
p str.is_a?(OpenURI::Meta) # => true
p str.content_type -
REXML
:: Instruction # ==(other) -> bool (22.0) -
other と self が同じ 処理命令である場合に真を返します。
other と self が同じ 処理命令である場合に真を返します。
同じとは、 REXML::Instruction#target と REXML::Instruction#content
が一致することを意味します。
@param other 比較対象 -
REXML
:: Instruction # target -> String (22.0) -
XML 処理命令のターゲットを返します。
XML 処理命令のターゲットを返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "t... -
WEBrick
:: HTTPResponse # body=(val) (22.0) -
クライアントに返す内容(エンティティボディ)をセットします。
クライアントに返す内容(エンティティボディ)をセットします。
自身が chunked であっても body の値はチャンク形式ではありません。
@param val メッセージボディを文字列か IO オブジェクトで指定します。
自身が chunked であってもチャンク形式にする必要はありません。
適切にチャンク形式エンコーディングされます。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.bod... -
WEBrick
:: HTTPResponse # to _ s -> String (22.0) -
実際にクライアントに送られるデータを文字列として返します。
実際にクライアントに送られるデータを文字列として返します。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 08:58:49 GMT
Server:
Content-Length: 4
hoge -
WEBrick
:: HTTPUtils :: FormData # [](header) -> String | nil (22.0) -
自身が multipart/form-data なデータの場合に、header で指定された ヘッダの値を文字列で返します。無ければ nil を返します。
自身が multipart/form-data なデータの場合に、header で指定された
ヘッダの値を文字列で返します。無ければ nil を返します。
@param header ヘッダ名を文字列で指定します。大文字と小文字を区別しません。
例:
require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q']['content-type'] #=> "plain/text"
end
end
MyCGI.new.start()