Class: Net::HTTP
Class Method Summary collapse
-
.get1(path, params, initheader = {}, &blk) ⇒ Object
support params.
-
.post1(path, params, initheader = {}, &blk) ⇒ Object
support params.
Class Method Details
.get1(path, params, initheader = {}, &blk) ⇒ Object
support params
12 13 14 15 16 |
# File 'lib/tagen/net/http.rb', line 12 def get1 path, params, initheader={}, &blk path = path + "?" + (String===params ? params : URI.encode_www_form(params)) req = Get.new(path, initheader) request req, &blk end |
.post1(path, params, initheader = {}, &blk) ⇒ Object
support params
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/tagen/net/http.rb', line 21 def post1 path, params, initheader={}, &blk req = Post.new(path, initheader) if String===params req.body = params req.content_type = 'application/x-www-form-urlencoded' else req.set_form_data(params) end request req, &blk end |