/usr/share/gtk-doc/html/libsoup-2.4/libsoup-2.4-HTML-Form-Support.html is in libsoup2.4-doc 2.44.2-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>HTML Form Support</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch04.html" title="Web Services APIs">
<link rel="prev" href="ch04.html" title="Web Services APIs">
<link rel="next" href="libsoup-2.4-XMLRPC-Support.html" title="XMLRPC Support">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="ch04.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch04.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-2.4-XMLRPC-Support.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libsoup-2.4-HTML-Form-Support.synopsis" class="shortcut">Top</a>
|
<a href="#libsoup-2.4-HTML-Form-Support.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libsoup-2.4-HTML-Form-Support"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libsoup-2.4-HTML-Form-Support.top_of_page"></a>HTML Form Support</span></h2>
<p>HTML Form Support — HTML form handling</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libsoup-2.4-HTML-Form-Support.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <libsoup/soup.h>
#define <a class="link" href="libsoup-2.4-HTML-Form-Support.html#SOUP-FORM-MIME-TYPE-MULTIPART:CAPS" title="SOUP_FORM_MIME_TYPE_MULTIPART">SOUP_FORM_MIME_TYPE_MULTIPART</a>
#define <a class="link" href="libsoup-2.4-HTML-Form-Support.html#SOUP-FORM-MIME-TYPE-URLENCODED:CAPS" title="SOUP_FORM_MIME_TYPE_URLENCODED">SOUP_FORM_MIME_TYPE_URLENCODED</a>
<a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-decode" title="soup_form_decode ()">soup_form_decode</a> (<em class="parameter"><code>const <span class="type">char</span> *encoded_form</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-decode-multipart" title="soup_form_decode_multipart ()">soup_form_decode_multipart</a> (<em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *file_control_name</code></em>,
<em class="parameter"><code><span class="type">char</span> **filename</code></em>,
<em class="parameter"><code><span class="type">char</span> **content_type</code></em>,
<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> **file</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode" title="soup_form_encode ()">soup_form_encode</a> (<em class="parameter"><code>const <span class="type">char</span> *first_field</code></em>,
<em class="parameter"><code>...</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode-datalist" title="soup_form_encode_datalist ()">soup_form_encode_datalist</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Keyed-Data-Lists.html#GData"><span class="type">GData</span></a> **form_data_set</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode-hash" title="soup_form_encode_hash ()">soup_form_encode_hash</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> *form_data_set</code></em>);
<span class="returnvalue">char</span> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode-valist" title="soup_form_encode_valist ()">soup_form_encode_valist</a> (<em class="parameter"><code>const <span class="type">char</span> *first_field</code></em>,
<em class="parameter"><code><span class="type">va_list</span> args</code></em>);
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new" title="soup_form_request_new ()">soup_form_request_new</a> (<em class="parameter"><code>const <span class="type">char</span> *method</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *first_field</code></em>,
<em class="parameter"><code>...</code></em>);
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new-from-datalist" title="soup_form_request_new_from_datalist ()">soup_form_request_new_from_datalist</a> (<em class="parameter"><code>const <span class="type">char</span> *method</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Keyed-Data-Lists.html#GData"><span class="type">GData</span></a> **form_data_set</code></em>);
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new-from-hash" title="soup_form_request_new_from_hash ()">soup_form_request_new_from_hash</a> (<em class="parameter"><code>const <span class="type">char</span> *method</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> *form_data_set</code></em>);
<a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new-from-multipart" title="soup_form_request_new_from_multipart ()">soup_form_request_new_from_multipart</a>
(<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code><a class="link" href="SoupMultipart.html" title="SoupMultipart"><span class="type">SoupMultipart</span></a> *multipart</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libsoup-2.4-HTML-Form-Support.description"></a><h2>Description</h2>
<p>
libsoup contains several help methods for processing HTML forms as
defined by <a class="ulink" href="http://www.w3.org/TR/html401/interact/forms.html#h-17.13" target="_top">the
HTML 4.01 specification</a>.
</p>
</div>
<div class="refsect1">
<a name="libsoup-2.4-HTML-Form-Support.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="SOUP-FORM-MIME-TYPE-MULTIPART:CAPS"></a><h3>SOUP_FORM_MIME_TYPE_MULTIPART</h3>
<pre class="programlisting">#define SOUP_FORM_MIME_TYPE_MULTIPART "multipart/form-data"
</pre>
<p>
A macro containing the value
<code class="literal">"multipart/form-data"</code>; the MIME type used for
posting form data that contains files to be uploaded.
</p>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="SOUP-FORM-MIME-TYPE-URLENCODED:CAPS"></a><h3>SOUP_FORM_MIME_TYPE_URLENCODED</h3>
<pre class="programlisting">#define SOUP_FORM_MIME_TYPE_URLENCODED "application/x-www-form-urlencoded"
</pre>
<p>
A macro containing the value
<code class="literal">"application/x-www-form-urlencoded"</code>; the default
MIME type for POSTing HTML form data.
</p>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-decode"></a><h3>soup_form_decode ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> * soup_form_decode (<em class="parameter"><code>const <span class="type">char</span> *encoded_form</code></em>);</pre>
<p>
Decodes <em class="parameter"><code>form</code></em>, which is an urlencoded dataset as defined in the
HTML 4.01 spec.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>encoded_form</code></em> :</span></p></td>
<td>data of type "application/x-www-form-urlencoded"</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a hash
table containing the name/value pairs from <em class="parameter"><code>encoded_form</code></em>, which you
can free with <a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#g-hash-table-destroy"><code class="function">g_hash_table_destroy()</code></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 utf8][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-decode-multipart"></a><h3>soup_form_decode_multipart ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> * soup_form_decode_multipart (<em class="parameter"><code><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a> *msg</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *file_control_name</code></em>,
<em class="parameter"><code><span class="type">char</span> **filename</code></em>,
<em class="parameter"><code><span class="type">char</span> **content_type</code></em>,
<em class="parameter"><code><a class="link" href="SoupMessageBody.html#SoupBuffer"><span class="type">SoupBuffer</span></a> **file</code></em>);</pre>
<p>
Decodes the "multipart/form-data" request in <em class="parameter"><code>msg</code></em>; this is a
convenience method for the case when you have a single file upload
control in a form. (Or when you don't have any file upload
controls, but are still using "multipart/form-data" anyway.) Pass
the name of the file upload control in <em class="parameter"><code>file_control_name</code></em>, and
<a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-decode-multipart" title="soup_form_decode_multipart ()"><code class="function">soup_form_decode_multipart()</code></a> will extract the uploaded file data
into <em class="parameter"><code>filename</code></em>, <em class="parameter"><code>content_type</code></em>, and <em class="parameter"><code>file</code></em>. All of the other form
control data will be returned (as strings, as with
<a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-decode" title="soup_form_decode ()"><code class="function">soup_form_decode()</code></a>) in the returned <a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
</p>
<p>
You may pass <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for <em class="parameter"><code>filename</code></em>, <em class="parameter"><code>content_type</code></em> and/or <em class="parameter"><code>file</code></em> if you do not
care about those fields. <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-decode-multipart" title="soup_form_decode_multipart ()"><code class="function">soup_form_decode_multipart()</code></a> may also
return <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in those fields if the client did not provide that
information. You must free the returned filename and content-type
with <a href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>, and the returned file data with <a class="link" href="SoupMessageBody.html#soup-buffer-free" title="soup_buffer_free ()"><code class="function">soup_buffer_free()</code></a>.
</p>
<p>
If you have a form with more than one file upload control, you will
need to decode it manually, using <a class="link" href="SoupMultipart.html#soup-multipart-new-from-message" title="soup_multipart_new_from_message ()"><code class="function">soup_multipart_new_from_message()</code></a>
and <a class="link" href="SoupMultipart.html#soup-multipart-get-part" title="soup_multipart_get_part ()"><code class="function">soup_multipart_get_part()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<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> containing a "multipart/form-data" request body</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>file_control_name</code></em> :</span></p></td>
<td>the name of the HTML file upload control, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>return location for the name of the uploaded file, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>content_type</code></em> :</span></p></td>
<td>return location for the MIME type of the uploaded file, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
<td>return location for the uploaded file data, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a hash
table containing the name/value pairs (other than
<em class="parameter"><code>file_control_name</code></em>) from <em class="parameter"><code>msg</code></em>, which you can free with
<a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#g-hash-table-destroy"><code class="function">g_hash_table_destroy()</code></a>. On error, it will return <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 utf8][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-encode"></a><h3>soup_form_encode ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * soup_form_encode (<em class="parameter"><code>const <span class="type">char</span> *first_field</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>
Encodes the given field names and values into a value of type
"application/x-www-form-urlencoded", as defined in the HTML 4.01
spec.
</p>
<p>
This method requires you to know the names of the form fields (or
at the very least, the total number of fields) at compile time; for
working with dynamic forms, use <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode-hash" title="soup_form_encode_hash ()"><code class="function">soup_form_encode_hash()</code></a> or
<a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode-datalist" title="soup_form_encode_datalist ()"><code class="function">soup_form_encode_datalist()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>first_field</code></em> :</span></p></td>
<td>name of the first form field</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>value of <em class="parameter"><code>first_field</code></em>, followed by additional field names
and values, terminated by <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the encoded form</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-encode-datalist"></a><h3>soup_form_encode_datalist ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * soup_form_encode_datalist (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Keyed-Data-Lists.html#GData"><span class="type">GData</span></a> **form_data_set</code></em>);</pre>
<p>
Encodes <em class="parameter"><code>form_data_set</code></em> into a value of type
"application/x-www-form-urlencoded", as defined in the HTML 4.01
spec. Unlike <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode-hash" title="soup_form_encode_hash ()"><code class="function">soup_form_encode_hash()</code></a>, this preserves the ordering
of the form elements, which may be required in some situations.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>form_data_set</code></em> :</span></p></td>
<td>a datalist containing name/value pairs</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the encoded form</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-encode-hash"></a><h3>soup_form_encode_hash ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * soup_form_encode_hash (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> *form_data_set</code></em>);</pre>
<p>
Encodes <em class="parameter"><code>form_data_set</code></em> into a value of type
"application/x-www-form-urlencoded", as defined in the HTML 4.01
spec.
</p>
<p>
Note that the HTML spec states that "The control names/values are
listed in the order they appear in the document." Since this method
takes a hash table, it cannot enforce that; if you care about the
ordering of the form fields, use <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode-datalist" title="soup_form_encode_datalist ()"><code class="function">soup_form_encode_datalist()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>form_data_set</code></em> :</span></p></td>
<td>a hash table containing
name/value pairs (as strings). <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 utf8]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the encoded form</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-encode-valist"></a><h3>soup_form_encode_valist ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> * soup_form_encode_valist (<em class="parameter"><code>const <span class="type">char</span> *first_field</code></em>,
<em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>
See <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode" title="soup_form_encode ()"><code class="function">soup_form_encode()</code></a>. This is mostly an internal method, used by
various other methods such as <a class="link" href="SoupURI.html#soup-uri-set-query-from-fields" title="soup_uri_set_query_from_fields ()"><code class="function">soup_uri_set_query_from_fields()</code></a> and
<a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new" title="soup_form_request_new ()"><code class="function">soup_form_request_new()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>first_field</code></em> :</span></p></td>
<td>name of the first form field</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td>
<td>pointer to additional values, as in <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-encode" title="soup_form_encode ()"><code class="function">soup_form_encode()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the encoded form</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-request-new"></a><h3>soup_form_request_new ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * soup_form_request_new (<em class="parameter"><code>const <span class="type">char</span> *method</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *first_field</code></em>,
<em class="parameter"><code>...</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessage.html" title="SoupMessage"><code class="literal">SoupMessage</code></a> and sets it up to send the given data
to <em class="parameter"><code>uri</code></em> via <em class="parameter"><code>method</code></em>. (That is, if <em class="parameter"><code>method</code></em> is "GET", it will encode
the form data into <em class="parameter"><code>uri</code></em>'s query field, and if <em class="parameter"><code>method</code></em> is "POST", it
will encode it into the <a class="link" href="SoupMessage.html" title="SoupMessage"><code class="literal">SoupMessage</code></a>'s request_body.)
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>method</code></em> :</span></p></td>
<td>the HTTP method, either "GET" or "POST"</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>the URI to send the form data to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>first_field</code></em> :</span></p></td>
<td>name of the first form field</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>value of <em class="parameter"><code>first_field</code></em>, followed by additional field names
and values, terminated by <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></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"><code class="literal">SoupMessage</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-request-new-from-datalist"></a><h3>soup_form_request_new_from_datalist ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * soup_form_request_new_from_datalist (<em class="parameter"><code>const <span class="type">char</span> *method</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Keyed-Data-Lists.html#GData"><span class="type">GData</span></a> **form_data_set</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessage.html" title="SoupMessage"><code class="literal">SoupMessage</code></a> and sets it up to send <em class="parameter"><code>form_data_set</code></em> to
<em class="parameter"><code>uri</code></em> via <em class="parameter"><code>method</code></em>, as with <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new" title="soup_form_request_new ()"><code class="function">soup_form_request_new()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>method</code></em> :</span></p></td>
<td>the HTTP method, either "GET" or "POST"</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>the URI to send the form data to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>form_data_set</code></em> :</span></p></td>
<td>the data to send to <em class="parameter"><code>uri</code></em>
</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"><code class="literal">SoupMessage</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-request-new-from-hash"></a><h3>soup_form_request_new_from_hash ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * soup_form_request_new_from_hash (<em class="parameter"><code>const <span class="type">char</span> *method</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> *form_data_set</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessage.html" title="SoupMessage"><code class="literal">SoupMessage</code></a> and sets it up to send <em class="parameter"><code>form_data_set</code></em> to
<em class="parameter"><code>uri</code></em> via <em class="parameter"><code>method</code></em>, as with <a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new" title="soup_form_request_new ()"><code class="function">soup_form_request_new()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>method</code></em> :</span></p></td>
<td>the HTTP method, either "GET" or "POST"</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>the URI to send the form data to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>form_data_set</code></em> :</span></p></td>
<td>the data to send to <em class="parameter"><code>uri</code></em>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 utf8]</span>
</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"><code class="literal">SoupMessage</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="soup-form-request-new-from-multipart"></a><h3>soup_form_request_new_from_multipart ()</h3>
<pre class="programlisting"><a class="link" href="SoupMessage.html" title="SoupMessage"><span class="returnvalue">SoupMessage</span></a> * soup_form_request_new_from_multipart
(<em class="parameter"><code>const <span class="type">char</span> *uri</code></em>,
<em class="parameter"><code><a class="link" href="SoupMultipart.html" title="SoupMultipart"><span class="type">SoupMultipart</span></a> *multipart</code></em>);</pre>
<p>
Creates a new <a class="link" href="SoupMessage.html" title="SoupMessage"><code class="literal">SoupMessage</code></a> and sets it up to send <em class="parameter"><code>multipart</code></em> to
<em class="parameter"><code>uri</code></em> via POST.
</p>
<p>
To send a <code class="literal">"multipart/form-data"</code> POST, first
create a <a class="link" href="SoupMultipart.html" title="SoupMultipart"><span class="type">SoupMultipart</span></a>, using <a class="link" href="libsoup-2.4-HTML-Form-Support.html#SOUP-FORM-MIME-TYPE-MULTIPART:CAPS" title="SOUP_FORM_MIME_TYPE_MULTIPART"><code class="literal">SOUP_FORM_MIME_TYPE_MULTIPART</code></a> as
the MIME type. Then use <a class="link" href="SoupMultipart.html#soup-multipart-append-form-string" title="soup_multipart_append_form_string ()"><code class="function">soup_multipart_append_form_string()</code></a> and
<a class="link" href="SoupMultipart.html#soup-multipart-append-form-file" title="soup_multipart_append_form_file ()"><code class="function">soup_multipart_append_form_file()</code></a> to add the value of each form
control to the multipart. (These are just convenience methods, and
you can use <a class="link" href="SoupMultipart.html#soup-multipart-append-part" title="soup_multipart_append_part ()"><code class="function">soup_multipart_append_part()</code></a> if you need greater
control over the part headers.) Finally, call
<a class="link" href="libsoup-2.4-HTML-Form-Support.html#soup-form-request-new-from-multipart" title="soup_form_request_new_from_multipart ()"><code class="function">soup_form_request_new_from_multipart()</code></a> to serialize the multipart
structure and create a <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>uri</code></em> :</span></p></td>
<td>the URI to send the form data to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>multipart</code></em> :</span></p></td>
<td>a "multipart/form-data" <a class="link" href="SoupMultipart.html" title="SoupMultipart"><span class="type">SoupMultipart</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"><code class="literal">SoupMessage</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
</div>
<div class="refsect1">
<a name="libsoup-2.4-HTML-Form-Support.see-also"></a><h2>See Also</h2>
<a class="link" href="SoupMultipart.html" title="SoupMultipart"><span class="type">SoupMultipart</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.19</div>
</body>
</html>
|