MultipartInputStream

Handles streams of multipart messages.

This adds support for the multipart responses. For handling the multiple parts the user needs to wrap the gio.input_stream.InputStream obtained by sending the request with a class@MultipartInputStream and use soup.multipart_input_stream.MultipartInputStream.nextPart before reading. Responses which are not wrapped will be treated like non-multipart responses.

Note that although #SoupMultipartInputStream is a gio.input_stream.InputStream, you should not read directly from it, and the results are undefined if you do.

Constructors

this
this(soup.message.Message msg, gio.input_stream.InputStream baseStream)

Creates a new #SoupMultipartInputStream that wraps the gio.input_stream.InputStream obtained by sending the classMessage.

Members

Functions

getHeaders
soup.message_headers.MessageHeaders getHeaders()

Obtains the headers for the part currently being processed.

nextPart
gio.input_stream.InputStream nextPart(gio.cancellable.Cancellable cancellable)

Obtains an input stream for the next part.

nextPartAsync
void nextPartAsync(int ioPriority, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Obtains a gio.input_stream.InputStream for the next request.

nextPartFinish
gio.input_stream.InputStream nextPartFinish(gio.async_result.AsyncResult result)

Finishes an asynchronous request for the next part.

Mixed In Members

From mixin PollableInputStreamT!()

canPoll
bool canPoll()

Checks if stream is actually pollable. Some classes may implement #GPollableInputStream but have only certain instances of that class be pollable. If this method returns false, then the behavior of other #GPollableInputStream methods is undefined.

createSource
glib.source.Source createSource(gio.cancellable.Cancellable cancellable)

Creates a #GSource that triggers when stream can be read, or cancellable is triggered or an error occurs. The callback on the source is of the #GPollableSourceFunc type.

isReadable
bool isReadable()

Checks if stream can be read.

readNonblocking
ptrdiff_t readNonblocking(ubyte[] buffer, gio.cancellable.Cancellable cancellable)

Attempts to read up to count bytes from stream into buffer, as with gio.input_stream.InputStream.read. If stream is not currently readable, this will immediately return gio.types.IOErrorEnum.WouldBlock, and you can use gio.pollable_input_stream.PollableInputStream.createSource to create a #GSource that will be triggered when stream is readable.

Inherited Members

From FilterInputStream

getBaseStream
gio.input_stream.InputStream getBaseStream()

Gets the base stream for the filter stream.

getCloseBaseStream
bool getCloseBaseStream()

Returns whether the base stream will be closed when stream is closed.

setCloseBaseStream
void setCloseBaseStream(bool closeBase)

Sets whether the base stream will be closed when stream is closed.

From PollableInputStream

canPoll
bool canPoll()

Checks if stream is actually pollable. Some classes may implement #GPollableInputStream but have only certain instances of that class be pollable. If this method returns false, then the behavior of other #GPollableInputStream methods is undefined.

createSource
glib.source.Source createSource(gio.cancellable.Cancellable cancellable)

Creates a #GSource that triggers when stream can be read, or cancellable is triggered or an error occurs. The callback on the source is of the #GPollableSourceFunc type.

isReadable
bool isReadable()

Checks if stream can be read.

readNonblocking
ptrdiff_t readNonblocking(ubyte[] buffer, gio.cancellable.Cancellable cancellable)

Attempts to read up to count bytes from stream into buffer, as with gio.input_stream.InputStream.read. If stream is not currently readable, this will immediately return gio.types.IOErrorEnum.WouldBlock, and you can use gio.pollable_input_stream.PollableInputStream.createSource to create a #GSource that will be triggered when stream is readable.