<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>SoupMessage</title> <meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> <link rel="home" href="index.html" title="libsoup Reference Manual"> <link rel="up" href="ch02.html" title="Core API"> <link rel="prev" href="SoupLogger.html" title="SoupLogger"> <link rel="next" href="libsoup-24-SoupMessageHeaders.html" title="SoupMessageHeaders"> <meta name="generator" content="GTK-Doc V1.11 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> <link rel="chapter" href="ch01.html" title="Tutorial"> <link rel="chapter" href="ch02.html" title="Core API"> <link rel="chapter" href="ch03.html" title="Web Services APIs"> <link rel="chapter" href="ch04.html" title="GNOME integration"> <link rel="chapter" href="ch05.html" title="Low-level Networking API"> <link rel="index" href="ix01.html" title="Index"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> <tr valign="middle"> <td><a accesskey="p" href="SoupLogger.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> <td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> <th width="100%" align="center">libsoup Reference Manual</th> <td><a accesskey="n" href="libsoup-24-SoupMessageHeaders.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> </tr> <tr><td colspan="5" class="shortcuts"> <a href="#SoupMessage.synopsis" class="shortcut">Top</a> | <a href="#SoupMessage.description" class="shortcut">Description</a> | <a href="#SoupMessage.object-hierarchy" class="shortcut">Object Hierarchy</a> | <a href="#SoupMessage.properties" class="shortcut">Properties</a> | <a href="#SoupMessage.signals" class="shortcut">Signals</a> </td></tr> </table> <div class="refentry" lang="en"> <a name="SoupMessage"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="SoupMessage.top_of_page"></a>SoupMessage</span></h2> <p>SoupMessage — An HTTP request and response.</p> </td> <td valign="top" align="right"></td> </tr></table></div> <div class="refsynopsisdiv"> <a name="SoupMessage.synopsis"></a><h2>Synopsis</h2> <pre class="synopsis"> <a class="link" href="SoupMessage.html#SoupMessage-struct" title="SoupMessage">SoupMessage</a>; <a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> * <a class="link" href="SoupMessage.html#soup-message-new" title="soup_message_new ()">soup_message_new</a> (const char *method, const char *uri_string); <a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> * <a class="link" href="SoupMessage.html#soup-message-new-from-uri" title="soup_message_new_from_uri ()">soup_message_new_from_uri</a> (const char *method, <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a> *uri); void <a class="link" href="SoupMessage.html#soup-message-set-request" title="soup_message_set_request ()">soup_message_set_request</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *content_type, <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse">SoupMemoryUse</a> req_use, const char *req_body, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize" >gsize</a> req_length); void <a class="link" href="SoupMessage.html#soup-message-set-response" title="soup_message_set_response ()">soup_message_set_response</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *content_type, <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse">SoupMemoryUse</a> resp_use, const char *resp_body, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize" >gsize</a> resp_length); enum <a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion">SoupHTTPVersion</a>; void <a class="link" href="SoupMessage.html#soup-message-set-http-version" title="soup_message_set_http_version ()">soup_message_set_http_version</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion">SoupHTTPVersion</a> version); <a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion">SoupHTTPVersion</a> <a class="link" href="SoupMessage.html#soup-message-get-http-version" title="soup_message_get_http_version ()">soup_message_get_http_version</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg); <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a> * <a class="link" href="SoupMessage.html#soup-message-get-uri" title="soup_message_get_uri ()">soup_message_get_uri</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg); void <a class="link" href="SoupMessage.html#soup-message-set-uri" title="soup_message_set_uri ()">soup_message_set_uri</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a> *uri); <a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> * <a class="link" href="SoupMessage.html#soup-message-get-address" title="soup_message_get_address ()">soup_message_get_address</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg); void <a class="link" href="SoupMessage.html#soup-message-set-status" title="soup_message_set_status ()">soup_message_set_status</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> status_code); void <a class="link" href="SoupMessage.html#soup-message-set-status-full" title="soup_message_set_status_full ()">soup_message_set_status_full</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> status_code, const char *reason_phrase); <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean" >gboolean</a> <a class="link" href="SoupMessage.html#soup-message-is-keepalive" title="soup_message_is_keepalive ()">soup_message_is_keepalive</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg); <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> <a class="link" href="SoupMessage.html#soup-message-add-header-handler" title="soup_message_add_header_handler ()">soup_message_add_header_handler</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *signal, const char *header, <a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback" >GCallback</a> callback, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data); <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> <a class="link" href="SoupMessage.html#soup-message-add-status-code-handler" title="soup_message_add_status_code_handler ()">soup_message_add_status_code_handler</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *signal, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> status_code, <a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback" >GCallback</a> callback, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data); enum <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags">SoupMessageFlags</a>; void <a class="link" href="SoupMessage.html#soup-message-set-flags" title="soup_message_set_flags ()">soup_message_set_flags</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags">SoupMessageFlags</a> flags); <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags">SoupMessageFlags</a> <a class="link" href="SoupMessage.html#soup-message-get-flags" title="soup_message_get_flags ()">soup_message_get_flags</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg); <a class="link" href="libsoup-24-SoupMessageBody.html#SoupBuffer" title="SoupBuffer">SoupBuffer</a> * (<a class="link" href="SoupMessage.html#SoupChunkAllocator" title="SoupChunkAllocator ()">*SoupChunkAllocator</a>) (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize" >gsize</a> max_len, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data); void <a class="link" href="SoupMessage.html#soup-message-set-chunk-allocator" title="soup_message_set_chunk_allocator ()">soup_message_set_chunk_allocator</a> (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="SoupMessage.html#SoupChunkAllocator" title="SoupChunkAllocator ()">SoupChunkAllocator</a> allocator, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data, <a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify" >GDestroyNotify</a> destroy_notify); #define <a class="link" href="SoupMessage.html#SOUP-MESSAGE-METHOD--CAPS" title="SOUP_MESSAGE_METHOD">SOUP_MESSAGE_METHOD</a> #define <a class="link" href="SoupMessage.html#SOUP-MESSAGE-URI--CAPS" title="SOUP_MESSAGE_URI">SOUP_MESSAGE_URI</a> #define <a class="link" href="SoupMessage.html#SOUP-MESSAGE-HTTP-VERSION--CAPS" title="SOUP_MESSAGE_HTTP_VERSION">SOUP_MESSAGE_HTTP_VERSION</a> #define <a class="link" href="SoupMessage.html#SOUP-MESSAGE-FLAGS--CAPS" title="SOUP_MESSAGE_FLAGS">SOUP_MESSAGE_FLAGS</a> #define <a class="link" href="SoupMessage.html#SOUP-MESSAGE-STATUS-CODE--CAPS" title="SOUP_MESSAGE_STATUS_CODE">SOUP_MESSAGE_STATUS_CODE</a> #define <a class="link" href="SoupMessage.html#SOUP-MESSAGE-REASON-PHRASE--CAPS" title="SOUP_MESSAGE_REASON_PHRASE">SOUP_MESSAGE_REASON_PHRASE</a> #define <a class="link" href="SoupMessage.html#SOUP-MESSAGE-SERVER-SIDE--CAPS" title="SOUP_MESSAGE_SERVER_SIDE">SOUP_MESSAGE_SERVER_SIDE</a> </pre> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="synopsis"> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject" >GObject</a> +----SoupMessage </pre> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.properties"></a><h2>Properties</h2> <pre class="synopsis"> "<a class="link" href="SoupMessage.html#SoupMessage--flags" title='The "flags" property'>flags</a>" <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags">SoupMessageFlags</a> : Read / Write "<a class="link" href="SoupMessage.html#SoupMessage--http-version" title='The "http-version" property'>http-version</a>" <a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion">SoupHTTPVersion</a> : Read / Write "<a class="link" href="SoupMessage.html#SoupMessage--method" title='The "method" property'>method</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" >gchar</a>* : Read / Write "<a class="link" href="SoupMessage.html#SoupMessage--reason-phrase" title='The "reason-phrase" property'>reason-phrase</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" >gchar</a>* : Read / Write "<a class="link" href="SoupMessage.html#SoupMessage--server-side" title='The "server-side" property'>server-side</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean" >gboolean</a> : Read / Write / Construct Only "<a class="link" href="SoupMessage.html#SoupMessage--status-code" title='The "status-code" property'>status-code</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> : Read / Write "<a class="link" href="SoupMessage.html#SoupMessage--uri" title='The "uri" property'>uri</a>" <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a>* : Read / Write </pre> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.signals"></a><h2>Signals</h2> <pre class="synopsis"> "<a class="link" href="SoupMessage.html#SoupMessage-finished" title='The "finished" signal'>finished</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-got-body" title='The "got-body" signal'>got-body</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-got-chunk" title='The "got-chunk" signal'>got-chunk</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-got-headers" title='The "got-headers" signal'>got-headers</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-got-informational" title='The "got-informational" signal'>got-informational</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-restarted" title='The "restarted" signal'>restarted</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-wrote-body" title='The "wrote-body" signal'>wrote-body</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-wrote-body-data" title='The "wrote-body-data" signal'>wrote-body-data</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-wrote-chunk" title='The "wrote-chunk" signal'>wrote-chunk</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-wrote-headers" title='The "wrote-headers" signal'>wrote-headers</a>" : Run First "<a class="link" href="SoupMessage.html#SoupMessage-wrote-informational" title='The "wrote-informational" signal'>wrote-informational</a>" : Run First </pre> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.description"></a><h2>Description</h2> <p> A <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> represents an HTTP message that is being sent or received. </p> <p> For client-side usage, you would create a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> with <a class="link" href="SoupMessage.html#soup-message-new" title="soup_message_new ()"><code class="function">soup_message_new()</code></a> or <a class="link" href="SoupMessage.html#soup-message-new-from-uri" title="soup_message_new_from_uri ()"><code class="function">soup_message_new_from_uri()</code></a>, set up its fields appropriate, and send it via a <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>. </p> <p> For server-side usage, <a class="link" href="SoupServer.html" title="SoupServer"><span class="type">SoupServer</span></a> will create <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>s automatically for incoming requests, which your application will receive via handlers. </p> <p> Note that libsoup's terminology here does not quite match the HTTP specification: in RFC 2616, an "HTTP-message" is <span class="emphasis"><em>either</em></span> a Request, <span class="emphasis"><em>or</em></span> a Response. In libsoup, a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> combines both the request and the response.</p> <p> </p> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.details"></a><h2>Details</h2> <div class="refsect2" lang="en"> <a name="SoupMessage-struct"></a><h3>SoupMessage</h3> <pre class="programlisting">typedef struct { const char *method; guint status_code; char *reason_phrase; SoupMessageBody *request_body; SoupMessageHeaders *request_headers; SoupMessageBody *response_body; SoupMessageHeaders *response_headers; } SoupMessage; </pre> <p> Represents an HTTP message being sent or received. </p> <p> <em class="parameter"><code>status_code</code></em> will normally be a <a class="link" href="libsoup-24-soup-status.html#SoupKnownStatusCode" title="enum SoupKnownStatusCode"><span class="type">SoupKnownStatusCode</span></a>, eg, <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-OK--CAPS"><code class="literal">SOUP_STATUS_OK</code></a>, though of course it might actually be an unknown status code. <em class="parameter"><code>reason_phrase</code></em> is the actual text returned from the server, which may or may not correspond to the "standard" description of <em class="parameter"><code>status_code</code></em>. At any rate, it is almost certainly not localized, and not very descriptive even if it is in the user's language; you should not use <em class="parameter"><code>reason_phrase</code></em> in user-visible messages. Rather, you should look at <em class="parameter"><code>status_code</code></em>, and determine an end-user-appropriate message based on that and on what you were trying to do. </p> <p> As described in the <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMessageBody" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> documentation, the <em class="parameter"><code>request_body</code></em> and <em class="parameter"><code>response_body</code></em> <code class="literal">data</code> fields will not necessarily be filled in at all times. When they are filled in, they will be terminated with a '\0' byte (which is not included in the <code class="literal">length</code>), so you can use them as ordinary C strings (assuming that you know that the body doesn't have any other '\0' bytes). </p> <p> For a client-side <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, <em class="parameter"><code>request_body</code></em>'s <code class="literal">data</code> is usually filled in right before libsoup writes the request to the network, but you should not count on this; use <a class="link" href="libsoup-24-SoupMessageBody.html#soup-message-body-flatten" title="soup_message_body_flatten ()"><code class="function">soup_message_body_flatten()</code></a> if you want to ensure that <code class="literal">data</code> is filled in. <em class="parameter"><code>response_body</code></em>'s <code class="literal">data</code> will be filled in before <a class="link" href="SoupMessage.html#SoupMessage-finished" title='The "finished" signal'><span class="type">"finished"</span></a> is emitted. </p> <p> For a server-side <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, <em class="parameter"><code>request_body</code></em>'s <code class="literal">data</code> will be filled in before <a class="link" href="SoupMessage.html#SoupMessage-got-body" title='The "got-body" signal'><span class="type">"got_body"</span></a> is emitted. </p> <p> To prevent the <code class="literal">data</code> field from being filled in at all (eg, if you are handling the data from a <a class="link" href="SoupMessage.html#SoupMessage-got-chunk" title='The "got-chunk" signal'><span class="type">"got_chunk"</span></a>, and so don't need to see it all at the end), call <a class="link" href="libsoup-24-SoupMessageBody.html#soup-message-body-set-accumulate" title="soup_message_body_set_accumulate ()"><code class="function">soup_message_body_set_accumulate()</code></a> on <em class="parameter"><code>response_body</code></em> or <em class="parameter"><code>request_body</code></em> as appropriate, passing <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS" ><code class="literal">FALSE</code></a>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term">const char *<em class="structfield"><code>method</code></em>;</span></p></td> <td> the HTTP method </td> </tr> <tr> <td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> <em class="structfield"><code>status_code</code></em>;</span></p></td> <td> the HTTP status code </td> </tr> <tr> <td><p><span class="term">char *<em class="structfield"><code>reason_phrase</code></em>;</span></p></td> <td> the status phrase associated with <em class="parameter"><code>status_code</code></em> </td> </tr> <tr> <td><p><span class="term"><a class="link" href="libsoup-24-SoupMessageBody.html#SoupMessageBody" title="SoupMessageBody">SoupMessageBody</a> *<em class="structfield"><code>request_body</code></em>;</span></p></td> <td> the request body </td> </tr> <tr> <td><p><span class="term"><a class="link" href="libsoup-24-SoupMessageHeaders.html#SoupMessageHeaders" title="SoupMessageHeaders">SoupMessageHeaders</a> *<em class="structfield"><code>request_headers</code></em>;</span></p></td> <td> the request headers </td> </tr> <tr> <td><p><span class="term"><a class="link" href="libsoup-24-SoupMessageBody.html#SoupMessageBody" title="SoupMessageBody">SoupMessageBody</a> *<em class="structfield"><code>response_body</code></em>;</span></p></td> <td> the response body </td> </tr> <tr> <td><p><span class="term"><a class="link" href="libsoup-24-SoupMessageHeaders.html#SoupMessageHeaders" title="SoupMessageHeaders">SoupMessageHeaders</a> *<em class="structfield"><code>response_headers</code></em>;</span></p></td> <td> the response headers </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-new"></a><h3>soup_message_new ()</h3> <pre class="programlisting"><a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> * soup_message_new (const char *method, const char *uri_string);</pre> <p> Creates a new empty <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, which will connect to <em class="parameter"><code>uri</code></em></p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>method</code></em> :</span></p></td> <td> the HTTP method for the created request </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>uri_string</code></em> :</span></p></td> <td> the destination endpoint (as a string) </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the new <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> (or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS" ><code class="literal">NULL</code></a> if <em class="parameter"><code>uri</code></em> could not be parsed). </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-new-from-uri"></a><h3>soup_message_new_from_uri ()</h3> <pre class="programlisting"><a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> * soup_message_new_from_uri (const char *method, <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a> *uri);</pre> <p> Creates a new empty <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, which will connect to <em class="parameter"><code>uri</code></em></p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>method</code></em> :</span></p></td> <td> the HTTP method for the created request </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td> <td> the destination endpoint (as a <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI"><span class="type">SoupURI</span></a>) </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the new <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-request"></a><h3>soup_message_set_request ()</h3> <pre class="programlisting">void soup_message_set_request (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *content_type, <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse">SoupMemoryUse</a> req_use, const char *req_body, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize" >gsize</a> req_length);</pre> <p> Convenience function to set the request body of a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>. If <em class="parameter"><code>content_type</code></em> is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS" ><code class="literal">NULL</code></a>, the request body must be empty as well.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>content_type</code></em> :</span></p></td> <td> MIME Content-Type of the body </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>req_use</code></em> :</span></p></td> <td> a <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse"><span class="type">SoupMemoryUse</span></a> describing how to handle <em class="parameter"><code>req_body</code></em> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>req_body</code></em> :</span></p></td> <td> a data buffer containing the body of the message request. </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>req_length</code></em> :</span></p></td> <td> the byte length of <em class="parameter"><code>req_body</code></em>. </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-response"></a><h3>soup_message_set_response ()</h3> <pre class="programlisting">void soup_message_set_response (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *content_type, <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse">SoupMemoryUse</a> resp_use, const char *resp_body, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize" >gsize</a> resp_length);</pre> <p> Convenience function to set the response body of a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>. If <em class="parameter"><code>content_type</code></em> is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS" ><code class="literal">NULL</code></a>, the response body must be empty as well.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>content_type</code></em> :</span></p></td> <td> MIME Content-Type of the body </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>resp_use</code></em> :</span></p></td> <td> a <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMemoryUse" title="enum SoupMemoryUse"><span class="type">SoupMemoryUse</span></a> describing how to handle <em class="parameter"><code>resp_body</code></em> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>resp_body</code></em> :</span></p></td> <td> a data buffer containing the body of the message response. </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>resp_length</code></em> :</span></p></td> <td> the byte length of <em class="parameter"><code>resp_body</code></em>. </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupHTTPVersion"></a><h3>enum SoupHTTPVersion</h3> <pre class="programlisting">typedef enum { SOUP_HTTP_1_0 = 0, SOUP_HTTP_1_1 = 1 } SoupHTTPVersion; </pre> <p> Indicates the HTTP protocol version being used.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><a name="SOUP-HTTP-1-0--CAPS"></a><span class="term"><code class="literal">SOUP_HTTP_1_0</code></span></p></td> <td> HTTP 1.0 (RFC 1945) </td> </tr> <tr> <td><p><a name="SOUP-HTTP-1-1--CAPS"></a><span class="term"><code class="literal">SOUP_HTTP_1_1</code></span></p></td> <td> HTTP 1.1 (RFC 2616) </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-http-version"></a><h3>soup_message_set_http_version ()</h3> <pre class="programlisting">void soup_message_set_http_version (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion">SoupHTTPVersion</a> version);</pre> <p> Sets the HTTP version on <em class="parameter"><code>msg</code></em>. The default version is <a class="link" href="SoupMessage.html#SOUP-HTTP-1-1--CAPS"><code class="literal">SOUP_HTTP_1_1</code></a>. Setting it to <a class="link" href="SoupMessage.html#SOUP-HTTP-1-0--CAPS"><code class="literal">SOUP_HTTP_1_0</code></a> will prevent certain functionality from being used.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td> <td> the HTTP version </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-get-http-version"></a><h3>soup_message_get_http_version ()</h3> <pre class="programlisting"><a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion">SoupHTTPVersion</a> soup_message_get_http_version (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg);</pre> <p> Gets the HTTP version of <em class="parameter"><code>msg</code></em>. This is the minimum of the version from the request and the version from the response.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the HTTP version </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-get-uri"></a><h3>soup_message_get_uri ()</h3> <pre class="programlisting"><a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a> * soup_message_get_uri (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg);</pre> <p> Gets <em class="parameter"><code>msg</code></em>'s URI</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the URI <em class="parameter"><code>msg</code></em> is targeted for. </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-uri"></a><h3>soup_message_set_uri ()</h3> <pre class="programlisting">void soup_message_set_uri (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a> *uri);</pre> <p> Sets <em class="parameter"><code>msg</code></em>'s URI to <em class="parameter"><code>uri</code></em>. If <em class="parameter"><code>msg</code></em> has already been sent and you want to re-send it with the new URI, you need to call <a class="link" href="SoupSession.html#soup-session-requeue-message" title="soup_session_requeue_message ()"><code class="function">soup_session_requeue_message()</code></a>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td> <td> the new <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI"><span class="type">SoupURI</span></a> </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-get-address"></a><h3>soup_message_get_address ()</h3> <pre class="programlisting"><a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> * soup_message_get_address (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg);</pre> <p> Gets the address <em class="parameter"><code>msg</code></em>'s URI points to. After first setting the URI on a message, this will be unresolved, although the message's session will resolve it before sending the message.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the address <em class="parameter"><code>msg</code></em>'s URI points to </td> </tr> </tbody> </table></div> <p class="since">Since 2.26</p> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-status"></a><h3>soup_message_set_status ()</h3> <pre class="programlisting">void soup_message_set_status (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> status_code);</pre> <p> Sets <em class="parameter"><code>msg</code></em>'s status code to <em class="parameter"><code>status_code</code></em>. If <em class="parameter"><code>status_code</code></em> is a known value, it will also set <em class="parameter"><code>msg</code></em>'s reason_phrase.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>status_code</code></em> :</span></p></td> <td> an HTTP status code </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-status-full"></a><h3>soup_message_set_status_full ()</h3> <pre class="programlisting">void soup_message_set_status_full (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> status_code, const char *reason_phrase);</pre> <p> Sets <em class="parameter"><code>msg</code></em>'s status code and reason phrase.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>status_code</code></em> :</span></p></td> <td> an HTTP status code </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>reason_phrase</code></em> :</span></p></td> <td> a description of the status </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-is-keepalive"></a><h3>soup_message_is_keepalive ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean" >gboolean</a> soup_message_is_keepalive (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg);</pre> <p> Determines whether or not <em class="parameter"><code>msg</code></em>'s connection can be kept alive for further requests after processing <em class="parameter"><code>msg</code></em>, based on the HTTP version, Connection header, etc.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS" ><code class="literal">TRUE</code></a> or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS" ><code class="literal">FALSE</code></a>. </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-add-header-handler"></a><h3>soup_message_add_header_handler ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> soup_message_add_header_handler (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *signal, const char *header, <a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback" >GCallback</a> callback, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data);</pre> <p> Adds a signal handler to <em class="parameter"><code>msg</code></em> for <em class="parameter"><code>signal</code></em>, as with <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect" ><code class="function">g_signal_connect()</code></a>, but with two differences: the <em class="parameter"><code>callback</code></em> will only be run if <em class="parameter"><code>msg</code></em> has a header named <em class="parameter"><code>header</code></em>, and it will only be run if no earlier handler cancelled or requeued the message. </p> <p> If <em class="parameter"><code>signal</code></em> is one of the "got" signals (eg, "got_headers"), or "finished" or "restarted", then <em class="parameter"><code>header</code></em> is matched against the incoming message headers (that is, the <span class="type">request_headers</span> for a client <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, or the <span class="type">response_headers</span> for a server <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>). If <em class="parameter"><code>signal</code></em> is one of the "wrote" signals, then <em class="parameter"><code>header</code></em> is matched against the outgoing message headers.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>signal</code></em> :</span></p></td> <td> signal to connect the handler to. </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td> <td> HTTP response header to match against </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td> <td> the header handler </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td> data to pass to <em class="parameter"><code>handler_cb</code></em> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the handler ID from <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect" ><code class="function">g_signal_connect()</code></a> </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-add-status-code-handler"></a><h3>soup_message_add_status_code_handler ()</h3> <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> soup_message_add_status_code_handler (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, const char *signal, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> status_code, <a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GCallback" >GCallback</a> callback, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data);</pre> <p> Adds a signal handler to <em class="parameter"><code>msg</code></em> for <em class="parameter"><code>signal</code></em>, as with <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect" ><code class="function">g_signal_connect()</code></a> but with two differences: the <em class="parameter"><code>callback</code></em> will only be run if <em class="parameter"><code>msg</code></em> has the status <em class="parameter"><code>status_code</code></em>, and it will only be run if no earlier handler cancelled or requeued the message. </p> <p> <em class="parameter"><code>signal</code></em> must be a signal that will be emitted after <em class="parameter"><code>msg</code></em>'s status is set. For a client <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, this means it can't be a "wrote" signal. For a server <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>, this means it can't be a "got" signal.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>signal</code></em> :</span></p></td> <td> signal to connect the handler to. </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>status_code</code></em> :</span></p></td> <td> status code to match against </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td> <td> the header handler </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td> data to pass to <em class="parameter"><code>handler_cb</code></em> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the handler ID from <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect" ><code class="function">g_signal_connect()</code></a> </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessageFlags"></a><h3>enum SoupMessageFlags</h3> <pre class="programlisting">typedef enum { #ifndef LIBSOUP_DISABLE_DEPRECATED SOUP_MESSAGE_OVERWRITE_CHUNKS = (1 << 3), #endif SOUP_MESSAGE_NO_REDIRECT = (1 << 1) } SoupMessageFlags; </pre> <p> Various flags that can be set on a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> to alter its behavior.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><a name="SOUP-MESSAGE-OVERWRITE-CHUNKS--CAPS"></a><span class="term"><code class="literal">SOUP_MESSAGE_OVERWRITE_CHUNKS</code></span></p></td> <td> Deprecated: equivalent to calling <a class="link" href="libsoup-24-SoupMessageBody.html#soup-message-body-set-accumulate" title="soup_message_body_set_accumulate ()"><code class="function">soup_message_body_set_accumulate()</code></a> on the incoming message body (ie, <code class="literal">response_body</code> for a client-side request), passing <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS" ><code class="literal">FALSE</code></a>. </td> </tr> <tr> <td><p><a name="SOUP-MESSAGE-NO-REDIRECT--CAPS"></a><span class="term"><code class="literal">SOUP_MESSAGE_NO_REDIRECT</code></span></p></td> <td> The session should not follow redirect (3xx) responses received by this message. </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-flags"></a><h3>soup_message_set_flags ()</h3> <pre class="programlisting">void soup_message_set_flags (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags">SoupMessageFlags</a> flags);</pre> <p> Sets the specified flags on <em class="parameter"><code>msg</code></em>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td> <td> a set of <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags"><span class="type">SoupMessageFlags</span></a> values </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-get-flags"></a><h3>soup_message_get_flags ()</h3> <pre class="programlisting"><a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags">SoupMessageFlags</a> soup_message_get_flags (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg);</pre> <p> Gets the flags on <em class="parameter"><code>msg</code></em></p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the flags </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupChunkAllocator"></a><h3>SoupChunkAllocator ()</h3> <pre class="programlisting"><a class="link" href="libsoup-24-SoupMessageBody.html#SoupBuffer" title="SoupBuffer">SoupBuffer</a> * (*SoupChunkAllocator) (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize" >gsize</a> max_len, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data);</pre> <p> The prototype for a chunk allocation callback. This should allocate a new <a class="link" href="libsoup-24-SoupMessageBody.html#SoupBuffer" title="SoupBuffer"><span class="type">SoupBuffer</span></a> and return it for the I/O layer to read message body data off the network into. </p> <p> If <em class="parameter"><code>max_len</code></em> is non-0, it indicates the maximum number of bytes that could be read, based on what is known about the message size. Note that this might be a very large number, and you should not simply try to allocate that many bytes blindly. If <em class="parameter"><code>max_len</code></em> is 0, that means that libsoup does not know how many bytes remain to be read, and the allocator should return a buffer of a size that it finds convenient. </p> <p> If the allocator returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS" ><code class="literal">NULL</code></a>, the message will be paused. It is up to the application to make sure that it gets unpaused when it becomes possible to allocate a new buffer.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> the chunk is being allocated for </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>max_len</code></em> :</span></p></td> <td> the maximum length that will be read, or 0. </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td> the data passed to <a class="link" href="SoupMessage.html#soup-message-set-chunk-allocator" title="soup_message_set_chunk_allocator ()"><code class="function">soup_message_set_chunk_allocator()</code></a> </td> </tr> <tr> <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> <td> the new buffer (or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS" ><code class="literal">NULL</code></a>) </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="soup-message-set-chunk-allocator"></a><h3>soup_message_set_chunk_allocator ()</h3> <pre class="programlisting">void soup_message_set_chunk_allocator (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="SoupMessage.html#SoupChunkAllocator" title="SoupChunkAllocator ()">SoupChunkAllocator</a> allocator, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data, <a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify" >GDestroyNotify</a> destroy_notify);</pre> <p> Sets an alternate chunk-allocation function to use when reading <em class="parameter"><code>msg</code></em>'s body. Every time data is available to read, libsoup will call <em class="parameter"><code>allocator</code></em>, which should return a <a class="link" href="libsoup-24-SoupMessageBody.html#SoupBuffer" title="SoupBuffer"><span class="type">SoupBuffer</span></a>. (See <a class="link" href="SoupMessage.html#SoupChunkAllocator" title="SoupChunkAllocator ()"><span class="type">SoupChunkAllocator</span></a> for additional details.) Libsoup will then read data from the network into that buffer, and update the buffer's <code class="literal">length</code> to indicate how much data it read. </p> <p> Generally, a custom chunk allocator would be used in conjunction with <a class="link" href="libsoup-24-SoupMessageBody.html#soup-message-body-set-accumulate" title="soup_message_body_set_accumulate ()"><code class="function">soup_message_body_set_accumulate()</code></a> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS" ><code class="literal">FALSE</code></a> and <a class="link" href="SoupMessage.html#SoupMessage-got-chunk" title='The "got-chunk" signal'><span class="type">"got_chunk"</span></a>, as part of a strategy to avoid unnecessary copying of data. However, you cannot assume that every call to the allocator will be followed by a call to your <code class="literal">got_chunk</code> handler; if an I/O error occurs, then the buffer will be unreffed without ever having been used. If your buffer-allocation strategy requires special cleanup, use <a class="link" href="libsoup-24-SoupMessageBody.html#soup-buffer-new-with-owner" title="soup_buffer_new_with_owner ()"><code class="function">soup_buffer_new_with_owner()</code></a> rather than doing the cleanup from the <code class="literal">got_chunk</code> handler. </p> <p> The other thing to remember when using non-accumulating message bodies is that the buffer passed to the <code class="literal">got_chunk</code> handler will be unreffed after the handler returns, just as it would be in the non-custom-allocated case. If you want to hand the chunk data off to some other part of your program to use later, you'll need to ref the <a class="link" href="libsoup-24-SoupMessageBody.html#SoupBuffer" title="SoupBuffer"><span class="type">SoupBuffer</span></a> (or its owner, in the <a class="link" href="libsoup-24-SoupMessageBody.html#soup-buffer-new-with-owner" title="soup_buffer_new_with_owner ()"><code class="function">soup_buffer_new_with_owner()</code></a> case) to ensure that the data remains valid.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>allocator</code></em> :</span></p></td> <td> the chunk allocator callback </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td> data to pass to <em class="parameter"><code>allocator</code></em> </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td> <td> destroy notifier to free <em class="parameter"><code>user_data</code></em> when <em class="parameter"><code>msg</code></em> is destroyed </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SOUP-MESSAGE-METHOD--CAPS"></a><h3>SOUP_MESSAGE_METHOD</h3> <pre class="programlisting">#define SOUP_MESSAGE_METHOD "method" </pre> <p> Alias for the <a class="link" href="SoupMessage.html#SoupMessage--method" title='The "method" property'><span class="type">"method"</span></a> property. (The message's HTTP method.)</p> <p> </p> </div> <hr> <div class="refsect2" lang="en"> <a name="SOUP-MESSAGE-URI--CAPS"></a><h3>SOUP_MESSAGE_URI</h3> <pre class="programlisting">#define SOUP_MESSAGE_URI "uri" </pre> <p> Alias for the <a class="link" href="SoupMessage.html#SoupMessage--uri" title='The "uri" property'><span class="type">"uri"</span></a> property. (The message's <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI"><span class="type">SoupURI</span></a>.)</p> <p> </p> </div> <hr> <div class="refsect2" lang="en"> <a name="SOUP-MESSAGE-HTTP-VERSION--CAPS"></a><h3>SOUP_MESSAGE_HTTP_VERSION</h3> <pre class="programlisting">#define SOUP_MESSAGE_HTTP_VERSION "http-version" </pre> <p> Alias for the <a class="link" href="SoupMessage.html#SoupMessage--http-version" title='The "http-version" property'><span class="type">"http-version"</span></a> property. (The message's <a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion"><span class="type">SoupHTTPVersion</span></a>.)</p> <p> </p> </div> <hr> <div class="refsect2" lang="en"> <a name="SOUP-MESSAGE-FLAGS--CAPS"></a><h3>SOUP_MESSAGE_FLAGS</h3> <pre class="programlisting">#define SOUP_MESSAGE_FLAGS "flags" </pre> <p> Alias for the <a class="link" href="SoupMessage.html#SoupMessage--flags" title='The "flags" property'><span class="type">"flags"</span></a> property. (The message's <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags"><span class="type">SoupMessageFlags</span></a>.)</p> <p> </p> </div> <hr> <div class="refsect2" lang="en"> <a name="SOUP-MESSAGE-STATUS-CODE--CAPS"></a><h3>SOUP_MESSAGE_STATUS_CODE</h3> <pre class="programlisting">#define SOUP_MESSAGE_STATUS_CODE "status-code" </pre> <p> Alias for the <a class="link" href="SoupMessage.html#SoupMessage--status-code" title='The "status-code" property'><span class="type">"status-code"</span></a> property. (The message's HTTP response status code.)</p> <p> </p> </div> <hr> <div class="refsect2" lang="en"> <a name="SOUP-MESSAGE-REASON-PHRASE--CAPS"></a><h3>SOUP_MESSAGE_REASON_PHRASE</h3> <pre class="programlisting">#define SOUP_MESSAGE_REASON_PHRASE "reason-phrase" </pre> <p> Alias for the <a class="link" href="SoupMessage.html#SoupMessage--reason-phrase" title='The "reason-phrase" property'><span class="type">"reason-phrase"</span></a> property. (The message's HTTP response reason phrase.)</p> <p> </p> </div> <hr> <div class="refsect2" lang="en"> <a name="SOUP-MESSAGE-SERVER-SIDE--CAPS"></a><h3>SOUP_MESSAGE_SERVER_SIDE</h3> <pre class="programlisting">#define SOUP_MESSAGE_SERVER_SIDE "server-side" </pre> <p> Alias for the <a class="link" href="SoupMessage.html#SoupMessage--server-side" title='The "server-side" property'><span class="type">"server-side"</span></a> property. (<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS" ><code class="literal">TRUE</code></a> if the message was created by <a class="link" href="SoupServer.html" title="SoupServer"><span class="type">SoupServer</span></a>.)</p> <p> </p> </div> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.property-details"></a><h2>Property Details</h2> <div class="refsect2" lang="en"> <a name="SoupMessage--flags"></a><h3>The <code class="literal">"flags"</code> property</h3> <pre class="programlisting"> "flags" <a class="link" href="SoupMessage.html#SoupMessageFlags" title="enum SoupMessageFlags">SoupMessageFlags</a> : Read / Write</pre> <p>Various message options.</p> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage--http-version"></a><h3>The <code class="literal">"http-version"</code> property</h3> <pre class="programlisting"> "http-version" <a class="link" href="SoupMessage.html#SoupHTTPVersion" title="enum SoupHTTPVersion">SoupHTTPVersion</a> : Read / Write</pre> <p>The HTTP protocol version to use.</p> <p>Default value: SOUP_HTTP_1_1</p> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage--method"></a><h3>The <code class="literal">"method"</code> property</h3> <pre class="programlisting"> "method" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" >gchar</a>* : Read / Write</pre> <p>The message's HTTP method.</p> <p>Default value: "GET"</p> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage--reason-phrase"></a><h3>The <code class="literal">"reason-phrase"</code> property</h3> <pre class="programlisting"> "reason-phrase" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar" >gchar</a>* : Read / Write</pre> <p>The HTTP response reason phrase.</p> <p>Default value: NULL</p> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage--server-side"></a><h3>The <code class="literal">"server-side"</code> property</h3> <pre class="programlisting"> "server-side" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean" >gboolean</a> : Read / Write / Construct Only</pre> <p>Whether or not the message is server-side rather than client-side.</p> <p>Default value: FALSE</p> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage--status-code"></a><h3>The <code class="literal">"status-code"</code> property</h3> <pre class="programlisting"> "status-code" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint" >guint</a> : Read / Write</pre> <p>The HTTP response status code.</p> <p>Allowed values: <= 599</p> <p>Default value: 0</p> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage--uri"></a><h3>The <code class="literal">"uri"</code> property</h3> <pre class="programlisting"> "uri" <a class="link" href="libsoup-24-SoupURI.html#SoupURI" title="SoupURI">SoupURI</a>* : Read / Write</pre> <p>The message's Request-URI.</p> </div> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.signal-details"></a><h2>Signal Details</h2> <div class="refsect2" lang="en"> <a name="SoupMessage-finished"></a><h3>The <code class="literal">"finished"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted when all HTTP processing is finished for a message. (After <a class="link" href="SoupMessage.html#SoupMessage-got-body" title='The "got-body" signal'><span class="type">"got_body"</span></a> for client-side messages, or after <a class="link" href="SoupMessage.html#SoupMessage-wrote-body" title='The "wrote-body" signal'><span class="type">"wrote_body"</span></a> for server-side messages.)</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-got-body"></a><h3>The <code class="literal">"got-body"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted after receiving the complete message body. (For a server-side message, this means it has received the request body. For a client-side message, this means it has received the response body and is nearly done with the message.) </p> <p> See also <a class="link" href="SoupMessage.html#soup-message-add-header-handler" title="soup_message_add_header_handler ()"><code class="function">soup_message_add_header_handler()</code></a> and <a class="link" href="SoupMessage.html#soup-message-add-status-code-handler" title="soup_message_add_status_code_handler ()"><code class="function">soup_message_add_status_code_handler()</code></a>, which can be used to connect to a subset of emissions of this signal.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-got-chunk"></a><h3>The <code class="literal">"got-chunk"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="libsoup-24-SoupMessageBody.html#SoupBuffer" title="SoupBuffer">SoupBuffer</a> *chunk, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted after receiving a chunk of a message body. Note that "chunk" in this context means any subpiece of the body, not necessarily the specific HTTP 1.1 chunks sent by the other side. </p> <p> If you cancel or requeue <em class="parameter"><code>msg</code></em> while processing this signal, then the current HTTP I/O will be stopped after this signal emission finished, and <em class="parameter"><code>msg</code></em>'s connection will be closed.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>chunk</code></em> :</span></p></td> <td> the just-read chunk </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-got-headers"></a><h3>The <code class="literal">"got-headers"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted after receiving all message headers for a message. (For a client-side message, this is after receiving the Status-Line and response headers; for a server-side message, it is after receiving the Request-Line and request headers.) </p> <p> See also <a class="link" href="SoupMessage.html#soup-message-add-header-handler" title="soup_message_add_header_handler ()"><code class="function">soup_message_add_header_handler()</code></a> and <a class="link" href="SoupMessage.html#soup-message-add-status-code-handler" title="soup_message_add_status_code_handler ()"><code class="function">soup_message_add_status_code_handler()</code></a>, which can be used to connect to a subset of emissions of this signal. </p> <p> If you cancel or requeue <em class="parameter"><code>msg</code></em> while processing this signal, then the current HTTP I/O will be stopped after this signal emission finished, and <em class="parameter"><code>msg</code></em>'s connection will be closed. (If you need to requeue a message--eg, after handling authentication or redirection--it is usually better to requeue it from a <a class="link" href="SoupMessage.html#SoupMessage-got-body" title='The "got-body" signal'><span class="type">"got_body"</span></a> handler rather than a <span class="type">"got_header"</span> handler, so that the existing HTTP connection can be reused.)</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-got-informational"></a><h3>The <code class="literal">"got-informational"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted after receiving a 1xx (Informational) response for a (client-side) message. The response_headers will be filled in with the headers associated with the informational response; however, those header values will be erased after this signal is done. </p> <p> If you cancel or requeue <em class="parameter"><code>msg</code></em> while processing this signal, then the current HTTP I/O will be stopped after this signal emission finished, and <em class="parameter"><code>msg</code></em>'s connection will be closed.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-restarted"></a><h3>The <code class="literal">"restarted"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted when a request that was already sent once is now being sent again (eg, because the first attempt received a redirection response, or because we needed to use authentication).</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-wrote-body"></a><h3>The <code class="literal">"wrote-body"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted immediately after writing the complete body for a message. (For a client-side message, this means that libsoup is done writing and is now waiting for the response from the server. For a server-side message, this means that libsoup has finished writing the response and is nearly done with the message.)</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-wrote-body-data"></a><h3>The <code class="literal">"wrote-body-data"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a class="link" href="libsoup-24-SoupMessageBody.html#SoupBuffer" title="SoupBuffer">SoupBuffer</a> *chunk, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted immediately after writing a portion of the message body to the network. </p> <p> Unlike <a class="link" href="SoupMessage.html#SoupMessage-wrote-chunk" title='The "wrote-chunk" signal'><span class="type">"wrote_chunk"</span></a>, this is emitted after every successful <code class="function">write()</code> call, not only after finishing a complete "chunk".</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>chunk</code></em> :</span></p></td> <td> the data written </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> <p>Since 2.4.1</p> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-wrote-chunk"></a><h3>The <code class="literal">"wrote-chunk"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted immediately after writing a body chunk for a message. </p> <p> Note that this signal is not parallel to <a class="link" href="SoupMessage.html#SoupMessage-got-chunk" title='The "got-chunk" signal'><span class="type">"got_chunk"</span></a>; it is emitted only when a complete chunk (added with <a class="link" href="libsoup-24-SoupMessageBody.html#soup-message-body-append" title="soup_message_body_append ()"><code class="function">soup_message_body_append()</code></a> or <a class="link" href="libsoup-24-SoupMessageBody.html#soup-message-body-append-buffer" title="soup_message_body_append_buffer ()"><code class="function">soup_message_body_append_buffer()</code></a>) has been written. To get more useful continuous progress information, use <a class="link" href="SoupMessage.html#SoupMessage-wrote-body-data" title='The "wrote-body-data" signal'><span class="type">"wrote_body_data"</span></a>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-wrote-headers"></a><h3>The <code class="literal">"wrote-headers"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted immediately after writing the headers for a message. (For a client-side message, this is after writing the request headers; for a server-side message, it is after writing the response headers.)</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="SoupMessage-wrote-informational"></a><h3>The <code class="literal">"wrote-informational"</code> signal</h3> <pre class="programlisting">void user_function (<a class="link" href="SoupMessage.html" title="SoupMessage">SoupMessage</a> *msg, <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer" >gpointer</a> user_data) : Run First</pre> <p> Emitted immediately after writing a 1xx (Informational) response for a (server-side) message.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><p><span class="term"><em class="parameter"><code>msg</code></em> :</span></p></td> <td> the message </td> </tr> <tr> <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> </div> <div class="refsect1" lang="en"> <a name="SoupMessage.see-also"></a><h2>See Also</h2> #SoupMessageHeaders, <a class="link" href="libsoup-24-SoupMessageBody.html#SoupMessageBody" title="SoupMessageBody"><span class="type">SoupMessageBody</span></a> </div> </div> <div class="footer"> <hr> Generated by GTK-Doc V1.11</div> </body> </html>