MessageBody
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "soup_message_body_get_type ()" ) ]
[ Compact ]
public class MessageBody
[struct@MessageBody] represents the request or response body of a [class@Message].
Note that while length always reflects the full length of the message body, data is normally
null, and will only be filled in after [method@MessageBody.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
).
Content:
Creation methods:
Methods:
- public void append (MemoryUse use, uint8[] data)
Appends data.length bytes from data to
this according to use.
- public void append_buffer (Buffer buffer)
Appends the data from buffer to
this.
- public void append_take (owned uint8[] data)
Appends data.length bytes from data to
this.
- public void complete ()
Tags this as being complete.
- public Buffer flatten ()
Fills in this's data field with a
buffer containing all of the data in this.
- public void free ()
Frees this.
- public bool get_accumulate ()
Gets the accumulate flag on this.
- public Buffer? get_chunk (int64 offset)
Gets a [struct@GLib.
- public void got_chunk (Buffer chunk)
Handles the [struct@MessageBody] part of receiving a chunk of data
from the network.
- public void set_accumulate (bool accumulate)
Sets or clears the accumulate flag on this
.
- public void truncate ()
Deletes all of the data in this.
- public void wrote_chunk (Buffer chunk)
Handles the [struct@MessageBody] part of writing a chunk of data to
the network.
Fields: