Method: DigitalFabric::AgentProxy#http_get_request_body

Defined in:
lib/tipi/digital_fabric/agent_proxy.rb

#http_get_request_body(id, req, limit) ⇒ Object



261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/tipi/digital_fabric/agent_proxy.rb', line 261

def http_get_request_body(id, req, limit)
  case limit
  when nil
    body = req.read
  else
    limit = limit.to_i
    body = nil
    req.each_chunk do |chunk|
      (body ||= +'') << chunk
      break if body.bytesize >= limit
    end
  end
  send_df_message(Protocol.http_request_body(id, body, req.complete?))
end