lib/manticore/response.rb
def body(&block)
      call_once
      @body ||= begin
                  if entity = @response.get_entity
                    EntityConverter.new.read_entity(entity, &block)
                  end
                rescue Java::JavaIo::IOException, Java::JavaNet::SocketException, IOError => e
                  raise StreamClosedException.new("Could not read from stream: #{e.message}")
                  # ensure
                  #   @request.release_connection
                end
    end
# Fetch the body content of this response. Will call the request if it has not been called yet.
# This fetches the input stream in Ruby; this isn't optimal, but it's faster than
# fetching the whole thing in Java then UTF-8 encoding it all into a giant Ruby string.
#
# This permits for streaming response bodies, as well.
#
# @example Streaming response
#
#     client.get("http://example.com/resource").on_success do |response|
#       response.body do |chunk|
#         # Do something with chunk, which is a parsed portion of the returned body
#       end
#     end
#
# @return [String] Reponse body
Fetch the body content of this response. Will call the request if it has not been called yet.
This fetches the input stream in Ruby; this isn't optimal, but it's faster than
fetching the whole thing in Java then UTF-8 encoding it all into a giant Ruby string.

This permits for streaming response bodies, as well.
Fetch the body content of this response . Will call the request if it has not been called yet . This fetches the input stream in Ruby ; this isn ' t optimal but it ' s faster than fetching the whole thing in Java then UTF - 8 encoding it all into a giant Ruby string . This permits for streaming response bodies as well .
def body(&block)
      call_once
      @body ||= begin
                  if entity = @response.get_entity
                    EntityConverter.new.read_entity(entity, &block)
                  end
                rescue Java::JavaIo::IOException, Java::JavaNet::SocketException, IOError => e
                  raise StreamClosedException.new("Could not read from stream: #{e.message}")
                end
    end
def body ( & block ) call_once @body ||= begin if entity = @response . get_entity EntityConverter . new . read_entity ( entity , & block ) end rescue Java :: JavaIo :: IOException , Java :: JavaNet :: SocketException , IOError => e raise StreamClosedException . new ( "Could not read from stream: #{e.message}" ) end end
Fetch the body content of this response.
Fetch the body content of this response .
# ensure #   @request.release_connection
None
String
block
example
None