Soup.MessageBody
Description: Reference for Soup.MessageBody

### Struct

# SoupMessageBody

#### Description [src]

    struct SoupMessageBody {
      guint8 data[];
      goffset length;
    }

`SoupMessageBody` represents the request or response body of a `SoupMessage`.

Note that while `length` always reflects the full length of the message body, `data` is normally `NULL`, and will only be filled in after `soup_message_body_flatten()` is called. For client-side messages, this automatically happens for the response body after it has been fully read. Likewise, for server-side messages, the request body is automatically filled in after being read.

As an added bonus, when `data` is filled in, it is always terminated with a `\0` byte (which is not reflected in `length`).

###### Structure members

`data:` `guint8`

  The data.

`length:` `goffset`

  Length of `data`.

#### Constructors

###### soup_message_body_new

Creates a new `SoupMessageBody`.

#### Instance methods

###### soup_message_body_append

Appends `length` bytes from `data` to `body` according to `use`.

###### soup_message_body_append_bytes

Appends the data from `buffer` to `body`.

###### soup_message_body_append_take

Appends `length` bytes from `data` to `body`.

###### soup_message_body_complete

Tags `body` as being complete.

###### soup_message_body_flatten

Fills in `body`‘s data field with a buffer containing all of the data in `body`.

###### soup_message_body_get_accumulate

Gets the accumulate flag on `body`.

###### soup_message_body_get_chunk

Gets a `GBytes` containing data from `body` starting at `offset`.

###### soup_message_body_got_chunk

Handles the `SoupMessageBody` part of receiving a chunk of data from the network.

###### soup_message_body_ref

Atomically increments the reference count of `body` by one.

###### soup_message_body_set_accumulate

Sets or clears the accumulate flag on `body`.

###### soup_message_body_truncate

Deletes all of the data in `body`.

###### soup_message_body_unref

Atomically decrements the reference count of `body` by one.

###### soup_message_body_wrote_chunk

Handles the `SoupMessageBody` part of writing a chunk of data to the network.