Session.queueMessage

Queues the message @msg for asynchronously sending the request and receiving a response in the current thread-default #GMainContext. If @msg has been processed before, any resources related to the time it was last sent are freed.

Upon message completion, the callback specified in @callback will be invoked. If after returning from this callback the message has not been requeued, @msg will be unreffed.

(The behavior above applies to a plain #SoupSession; if you are using #SoupSessionAsync or #SoupSessionSync, then the #GMainContext that is used depends on the settings of #SoupSession:async-context and #SoupSession:use-thread-context, and for #SoupSessionSync, the message will actually be sent and processed in another thread, with only the final callback occurring in the indicated #GMainContext.)

Contrast this method with soup_session_send_async(), which also asynchronously sends a message, but returns before reading the response body, and allows you to read the response via a #GInputStream.

class Session
void
queueMessage

Parameters

msg Message

the message to queue

callback SoupSessionCallback

a #SoupSessionCallback which will be called after the message completes or when an unrecoverable error occurs.

userData void*

a pointer passed to @callback.

Meta