soup_auth_authenticate (auth, authdata->username, authdata->password);
}
+static void soap_restarted (SoupMessage *msg, gpointer data)
+{
+ xmlOutputBuffer *buf = data;
+
+ /* In violation of RFC2616, libsoup will change a POST request to
+ a GET on receiving a 302 redirect. */
+ printf("Working around libsoup bug with redirect\n");
+ g_object_set (msg, SOUP_MESSAGE_METHOD, "POST", NULL);
+
+ soup_message_set_request(msg, "text/xml", SOUP_MEMORY_COPY,
+ (gchar *)buf->buffer->content,
+ buf->buffer->use);
+}
int main(int argc, char **argv)
{
SoupSession *sess;
soup_message_set_request(msg, "application/xml", SOUP_MEMORY_COPY,
(gchar *)buf->buffer->content,
buf->buffer->use);
+
+ g_signal_connect (msg, "restarted", G_CALLBACK (soap_restarted), buf);
status = soup_session_send_message(sess, msg);