Class: HTTP::Message::Body

Class | HTTP::Message::Body
In: | lib/httpclient/http.rb
Parent: | Object

Represents HTTP message body.

### Methods

content dump dump_chunked init_request init_response new

### Classes and Modules

Class HTTP::Message::Body::Parts

### Constants

DEFAULT_CHUNK_SIZE | = | 1024 * 16 |  | Default value for chunk_size

### Attributes

chunk_size | [RW] | maxbytes of IO#read for streaming request. See DEFAULT_CHUNK_SIZE.
size | [R] | Size of body. nil when size is unknown (e.g. chunked response).

### Public Class methods

new()

Creates a Message::Body. Use init_request or init_response for acutual initialize.

### Public Instance methods

content()

Returns a message body itself.

dump(header = '', dev = '')

Dumps message body to given dev. dev needs to respond to <<.

Message header must be given as the first argument for performance reason. (header is dumped to dev, too) If no dev (the second argument) given, this method returns a dumped String.

dump_chunked(header = '', dev = '')

Dumps message body with chunked encoding to given dev. dev needs to respond to <<.

Message header must be given as the first argument for performance reason. (header is dumped to dev, too) If no dev (the second argument) given, this method returns a dumped String.

init_request(body = nil, boundary = nil)

Initialize this instance as a request.

init_response(body = nil)

Initialize this instance as a response.

[Validate]