275件ヒット
[1-100件を表示]
(0.094秒)
種類
- インスタンスメソッド (253)
- 特異メソッド (11)
- ライブラリ (11)
クラス
- CSV (11)
-
CSV
:: FieldInfo (11) -
CSV
:: Row (11) -
Net
:: HTTP (220)
モジュール
- Kernel (11)
キーワード
-
cgi
/ session (11) -
create
_ header (11) - get (22)
- get2 (22)
- head (11)
- head2 (22)
- new (11)
- patch (22)
- post (22)
- post2 (22)
-
request
_ get (22) -
request
_ head (22) -
request
_ post (22) -
send
_ request (11) -
write
_ headers? (11)
検索結果
先頭5件
-
CSV
:: FieldInfo # header=(val) (21100.0) -
ヘッダを表す文字列をセットします。
ヘッダを表す文字列をセットします。
@param val ヘッダを表す文字列を指定します。 -
CSV
# write _ headers? -> bool (6106.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
result # => "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... -
cgi
/ session (6006.0) -
CGI のセッション管理を行うライブラリ。
...CGI のセッション管理を行うライブラリ。
セッションとは、HTTP の一連のリクエストとレスポンスが属するべき
コンテクスト (状況) のことをいいます。
セッション管理には従来通り cgi ライブラリが提供する
クッキーを使......i/session を使用した方がよりわかりやすいでしょう。
セッション情報は Hash ライクなインターフェースです。
セッションはセッション ID とプログラムが記録した
セッション情報から構成されます。
デフォルトでは CGI::Sessi......くないよ
@session = CGI::Session.new(@cgi) # セッションはこうして生成する。
@cmd = "#{@cgi['cmd'].first}" # ruby 1.8 でも動くように(warning は出ます)
@cmd = 'start' if @cmd.empty?
@header = { "type" => "text/html",... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (202.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w')......{|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (202.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w')......{|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (202.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...ヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
dest は時代遅れの引数です。利用しないでください。
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=subject&target=ruby') do |str|
f.write str
end
}
//}
@see Net::HTTP#request_post... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (202.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...ヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。
dest は時代遅れの引数です。利用しないでください。
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=subject&target=ruby') do |str|
f.write str
end
}
//}
@see Net::HTTP#request_post... -
Net
:: HTTP # send _ request(name , path , data = nil , header = nil) -> Net :: HTTPResponse (201.0) -
HTTP リクエストをサーバに送り、そのレスポンスを Net::HTTPResponse のインスタンスとして返します。
...スを文字列で与えます。
@param data リクエストのボディを文字列で与えます。
@param header リクエストのヘッダをハッシュで与えます。
//emlist[例][ruby]{
response = http.send_request('GET', '/index.html')
puts response.body
//}
@see Net::HTTP#request... -
Net
:: HTTP # patch(path , data , initheader=nil , dest=nil) -> Net :: HTTPResponse (200.0) -
サーバ上の path にあるエンティティに対し文字列 data を PATCH リクエストで送ります。
サーバ上の path にあるエンティティに対し文字列 data を
PATCH リクエストで送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。
Dest は時代遅れの引数です。利用しないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param path POST先のパスを文字列で指定します。... -
Net
:: HTTP # patch(path , data , initheader=nil , dest=nil) {|body _ segment| . . . } -> Net :: HTTPResponse (200.0) -
サーバ上の path にあるエンティティに対し文字列 data を PATCH リクエストで送ります。
サーバ上の path にあるエンティティに対し文字列 data を
PATCH リクエストで送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の HTTPResponse オブジェクトは有効な body を
持ちません。
Dest は時代遅れの引数です。利用しないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param path POST先のパスを文字列で指定します。...