Skip to content

class ResponseBody public ​

Represents a response body from an HTTP Request. Each request writes to a tmpfile asynchronously, the body retains an handle to this io.

#on_read(chunk_size, &block) public ​

Reads a buffered stream of (chunk_size) into (block)

Arguments ​

  • chunk_size - bytes to read from the response io at a time
  • block - a callback called with the buffer until the io is read

#json public ​

Get this response body parsed as json

#all public ​

Get this response body as a string