MessageBody

#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).

Constructors

this
this()

Creates a new #SoupMessageBody.

Members

Functions

appendBytes
void appendBytes(glib.bytes.Bytes buffer)

Appends the data from buffer to body.

complete
void complete()

Tags body as being complete.

flatten
glib.bytes.Bytes flatten()

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

getAccumulate
bool getAccumulate()

Gets the accumulate flag on body.

getChunk
glib.bytes.Bytes getChunk(long offset)

Gets a glib.bytes.Bytes containing data from body starting at offset.

gotChunk
void gotChunk(glib.bytes.Bytes chunk)

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

setAccumulate
void setAccumulate(bool accumulate)

Sets or clears the accumulate flag on body.

truncate
void truncate()

Deletes all of the data in body.

wroteChunk
void wroteChunk(glib.bytes.Bytes chunk)

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

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.