Methods
- A
- C
- N
- P
- R
- S
Class Public methods
new(uri, config)
Link
Source: show
# File sample/drb/http0.rb, line 39 def initialize(uri, config) @uri = uri @res = nil @config = config @msg = DRbMessage.new(config) @proxy = ENV['HTTP_PROXY'] end
Instance Public methods
post(url, data)
Link
Source: show
# File sample/drb/http0.rb, line 61 def post(url, data) it = URI.parse(url) path = [(it.path=='' ? '/' : it.path), it.query].compact.join('?') http = Net::HTTP.new(it.host, it.port) sio = StrStream.new http.post(path, data, {'Content-Type'=>'application/octetstream;'}) do |str| sio.write(str) if @config[:load_limit] < sio.buf.size raise TypeError, 'too large packet' end end @reply_stream = sio end