Class: Riddl::Client::SimulateRequest
- Inherits:
-
Net::HTTPGenericRequest
- Object
- Net::HTTPGenericRequest
- Riddl::Client::SimulateRequest
- Defined in:
- lib/ruby/riddl/client.rb
Overview
}}}
Instance Method Summary collapse
-
#initialize(method, path, parameters, headers, qs) ⇒ SimulateRequest
constructor
{{{.
- #simulate ⇒ Object
- #supply_default_content_type ⇒ Object
Constructor Details
#initialize(method, path, parameters, headers, qs) ⇒ SimulateRequest
{{{
405 406 407 408 409 410 411 412 |
# File 'lib/ruby/riddl/client.rb', line 405 def initialize(method, path, parameters, headers, qs) path = (path.strip == '' ? '/' : path) path += "?#{qs}" unless qs == '' super method, true, true, path, headers tmp = Protocols::HTTP::Generator.new(parameters,self).generate(:input) self.content_length = tmp.size self.body_stream = tmp end |
Instance Method Details
#simulate ⇒ Object
418 419 420 421 422 423 424 425 426 |
# File 'lib/ruby/riddl/client.rb', line 418 def simulate sock = StringIO.new('') sock.define_singleton_method(:io) do sock end self.exec(sock,"1.1",self.path) sock.rewind [nil, sock, []] end |
#supply_default_content_type ⇒ Object
414 415 416 |
# File 'lib/ruby/riddl/client.rb', line 414 def supply_default_content_type ### none, Protocols::HTTP::Generator handles this end |