Session.send

Synchronously sends @msg and waits for the beginning of a response. On success, a #GInputStream will be returned which you can use to read the response body. ("Success" here means only that an HTTP response was received and understood; it does not necessarily mean that a 2xx class status code was received.)

If non-%NULL, @cancellable can be used to cancel the request; soup_session_send() will return a %G_IO_ERROR_CANCELLED error. Note that with requests that have side effects (eg, <literal>POST</literal>, <literal>PUT</literal>, <literal>DELETE</literal>) it is possible that you might cancel the request after the server acts on it, but before it returns a response, leaving the remote resource in an unknown state.

If @msg is requeued due to a redirect or authentication, the initial (3xx/401/407) response body will be suppressed, and soup_session_send() will only return once a final response has been received.

Contrast this method with soup_session_send_message(), which also synchronously sends a #SoupMessage, but doesn't return until the response has been completely read.

(Note that this method cannot be called on the deprecated #SoupSessionAsync subclass.)

class Session
InputStream
send
(,
Cancellable cancellable
)

Parameters

msg Message

a #SoupMessage

cancellable Cancellable

a #GCancellable

Return Value

Type: InputStream

a #GInputStream for reading the response body, or %NULL on error.

Throws

GException on failure.

Meta

Since

2.42