soup.message_body
Module for [MessageBody] class
class MessageBody
Types 1
classMessageBody : gobject.boxed.Boxed
#SoupMessageBody 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 [soup.message_body.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).
Methods
MessageBody self()Returns `this`, for use in `with` statements.void appendBytes(glib.bytes.Bytes buffer)Appends the data from buffer to body.void complete()Tags body as being complete.glib.bytes.Bytes flatten()Fills in body's data field with a buffer containing all of the data in body.bool getAccumulate()Gets the accumulate flag on body.glib.bytes.Bytes getChunk(long offset)Gets a [glib.bytes.Bytes] containing data from body starting at offset.void gotChunk(glib.bytes.Bytes chunk)Handles the #SoupMessageBody part of receiving a chunk of data from the network.void setAccumulate(bool accumulate)Sets or clears the accumulate flag on body.void truncate()Deletes all of the data in body.void wroteChunk(glib.bytes.Bytes chunk)Handles the #SoupMessageBody part of writing a chunk of data to the network.