33件ヒット
[1-33件を表示]
(0.284秒)
種類
- インスタンスメソッド (22)
- ライブラリ (11)
ライブラリ
-
net
/ http (22)
モジュール
-
Net
:: HTTPHeader (22)
キーワード
-
form
_ data= (11) -
net
/ http (11)
検索結果
先頭3件
-
Net
:: HTTPHeader # set _ form _ data(params , sep = & # 39;&& # 39;) -> () (15147.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...HTMLのフォームのデータ params から
ヘッダフィールドとボディを設定します。
ヘッダフィールド Content-Type: には
'application/x-www-form-urlencoded' が設定されます。
@param params HTML のフォームデータの Hash を与えます。
@param sep デ......w.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"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"
//}... -
net
/ http (54.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...'/index.html')
//}
//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}
//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'uri'
url = URI.parse('http://www.example.com/index.html')
res =......Net::HTTP.start(url.host, url.port) {|http|
http.get('/index.html')
}
puts res.body
//}
//emlist[例4: 上の例よりさらに汎用的な例][ruby]{
require 'net/http'
url = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.p......細かく制御する
url = URI.parse('http://www.example.com/todo.cgi')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'jack', 'pass'
req.set_form_data({'from'=>'2005-01-01', 'to'=>'2005-03-31'})
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
case res
when Net::HTTPSu... -
Net
:: HTTPHeader # form _ data=(params) (47.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...HTMLのフォームのデータ params から
ヘッダフィールドとボディを設定します。
ヘッダフィールド Content-Type: には
'application/x-www-form-urlencoded' が設定されます。
@param params HTML のフォームデータの Hash を与えます。
@param sep デ......w.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"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"
//}...