種類
- インスタンスメソッド (979)
- ライブラリ (28)
- 文書 (11)
- 特異メソッド (11)
クラス
- CGI (11)
- CSV (55)
-
CSV
:: FieldInfo (11) -
CSV
:: Row (121) -
CSV
:: Table (44) -
Net
:: HTTP (198) -
Net
:: HTTPGenericRequest (22) - OptionParser (132)
-
URI
:: MailTo (11)
モジュール
-
Net
:: HTTPHeader (385)
キーワード
- [] (33)
- []= (11)
-
add
_ field (11) -
basic
_ auth (11) -
cgi
/ session (11) - chunked? (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type (11) -
content
_ type= (11) - delete (33)
-
delete
_ if (11) - each (22)
-
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ key (11) -
each
_ name (11) -
each
_ value (11) - fetch (33)
- field (11)
-
form
_ data= (11) - get (22)
- get2 (22)
-
get
_ fields (11) - head2 (22)
- header (22)
- header? (11)
-
header
_ converters (11) -
header
_ row? (22) - headers (44)
- include? (11)
- index (11)
- key? (11)
-
main
_ type (11) - method (11)
- new (11)
-
on
_ head (11) -
on
_ tail (11) - parse (22)
- parse! (11)
- post (22)
- post2 (22)
-
proxy
_ basic _ auth (11) - range (11)
-
range
_ length (11) -
request
_ body _ permitted? (11) -
request
_ get (22) -
request
_ head (22) -
request
_ post (22) -
response
_ body _ permitted? (11) -
return
_ headers? (11) -
ruby 1
. 8 . 4 feature (11) -
send
_ request (11) -
set
_ content _ type (11) -
set
_ form _ data (11) -
set
_ range (33) - shell (6)
-
sub
_ type (11) - summarize (22)
-
summary
_ indent (11) -
summary
_ indent= (11) -
summary
_ width (11) -
summary
_ width= (11) -
to
_ a (11) -
type
_ params (11) -
values
_ at (11) -
webrick
/ cgi (11) -
write
_ headers? (11)
検索結果
先頭5件
- Net
:: HTTP # head(path , header = nil) -> Net :: HTTPResponse - Net
:: HTTPHeader # each _ header {|name , val| . . . . } -> () - Net
:: HTTP # head2(path , header = nil) -> Net :: HTTPResponse - Net
:: HTTP # head2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse - Net
:: HTTP # request _ head(path , header = nil) -> Net :: HTTPResponse
-
Net
:: HTTP # head(path , header = nil) -> Net :: HTTPResponse (24525.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。
...ィティのヘッダのみを取得します。
Net::HTTPResponse のインスタンスを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュで......ram header リクエストの HTTP ヘッダをハッシュで指定します。
1.1 互換モードの場合は、レスポンスに応じて例外が発生します。
//emlist[例][ruby]{
require 'net/http'
response = nil
Net::HTTP.start('some.www.server', 80) {|http|
response = http.head('/......index.html')
}
p response['content-type']
//}
@see Net::HTTP#request_head... -
Net
:: HTTPHeader # each _ header {|name , val| . . . . } -> () (15424.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...//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
:: HTTP # head2(path , header = nil) -> Net :: HTTPResponse (12534.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...ティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュで......文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head... -
Net
:: HTTP # head2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (12534.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...ティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュで......文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head... -
Net
:: HTTP # request _ head(path , header = nil) -> Net :: HTTPResponse (12434.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...ティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュで......文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head... -
Net
:: HTTP # request _ head(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (12434.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...ティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュで......文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head... -
CGI
# header(options = "text / html") -> String (12396.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
...: type
Content-Type ヘッダです。デフォルトは "text/html" です。
: charset
ボディのキャラクタセットを Content-Type ヘッダに追加します。
: nph
真偽値を指定します。真ならば、HTTP のバージョン、ステータスコード、
Date ヘッ......ダをセットします。また Server と Connection の各ヘッダにもデフォルト値をセットします。
偽を指定する場合は、これらの値を明示的にセットしてください。
: status
HTTP のステータスコードを指定します。
このリストの......ます。
: server
サーバソフトウェアの名称指定します。Server ヘッダに対応します。
: connection
接続の種類を指定します。Connection ヘッダに対応します。
: length
送信するコンテンツの長さを指定します。Content-Length ヘッダ... -
CSV
:: FieldInfo # header -> String | nil (12354.0) -
利用可能な場合はヘッダを表す文字列を返します。
...返します。
//emlist[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.header
Date.parse(field)
end
p csv.first
# => "date1"
# => "date2"
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),......+0s,2299161j)> "date2":#<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>>
//}... -
OptionParser
# on _ head(*arg , &block) -> self (12331.0) -
オプションを取り扱うためのブロックを自身の持つリストの最初に登録します。
...ser#on と同様です。
@param block OptionParser#on と同様です。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
puts opts.help
# => Usage: test [options]
# -i, --......init
# -u, --update
# -h, --help
//}
@see OptionParser#on, OptionParser#on_tail... -
CSV
# write _ headers? -> bool (12330.0) -
ヘッダを出力先に書き込む場合は真を返します。 そうでない場合は偽を返します。
...//emlist[例][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv.write_headers? # => nil
header = ["header1", "header2"]
row = ["row1_1", "row1_2"]
result = CSV.generate(headers: header, write_headers: false) do |csv|
csv.write_headers? # => false
csv << row
end
resu......lt # => "row1_1,row1_2\n"
result = CSV.generate(headers: header, write_headers: true) do |csv|
csv.write_headers? # => true
csv << row
end
result # => "header1,header2\nrow1_1,row1_2\n"
//}
@see CSV.new...