~ubuntu-branches/ubuntu/quantal/libsoup2.4/quantal-proposed

« back to all changes in this revision

Viewing changes to docs/reference/html/libsoup-client-howto.html

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-02-10 17:26:01 UTC
  • mfrom: (1.5.9)
  • Revision ID: package-import@ubuntu.com-20120210172601-s2yjsyrgkltxsaxw
Tags: 2.37.5.1-0ubuntu1
New upstream version (lp: #928820)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
<td valign="top" align="right"></td>
30
30
</tr></table></div>
31
31
<div class="refsect2">
32
 
<a name="id438435"></a><h3>Creating a <span class="type">SoupSession</span>
 
32
<a name="id557150"></a><h3>Creating a <span class="type">SoupSession</span>
33
33
</h3>
34
34
<p>
35
35
The first step in using the client API is to create a <a class="link" href="SoupSession.html" title="SoupSession"><span class="type">SoupSession</span></a>. The session object
230
230
</div>
231
231
<hr>
232
232
<div class="refsect2">
233
 
<a name="id412251"></a><h3>Creating and Sending SoupMessages</h3>
 
233
<a name="id530966"></a><h3>Creating and Sending SoupMessages</h3>
234
234
<p>
235
235
Once you have a session, you do HTTP traffic using <a class="link" href="SoupMessage.html" title="SoupMessage"><span class="type">SoupMessage</span></a>. In the simplest
236
236
case, you only need to create the message and it's ready to send:
290
290
flag.
291
291
</p>
292
292
<div class="refsect3">
293
 
<a name="id412355"></a><h4>Sending a Message Synchronously</h4>
 
293
<a name="id531070"></a><h4>Sending a Message Synchronously</h4>
294
294
<p>
295
295
To send a message and wait for the response, use <a class="link" href="SoupSession.html#soup-session-send-message" title="soup_session_send_message ()"><code class="function">soup_session_send_message</code></a>:
296
296
</p>
324
324
</p>
325
325
</div>
326
326
<div class="refsect3">
327
 
<a name="id412423"></a><h4>Sending a Message Asynchronously</h4>
 
327
<a name="id531139"></a><h4>Sending a Message Asynchronously</h4>
328
328
<p>
329
329
To send a message asynchronously, use <a class="link" href="SoupSession.html#soup-session-queue-message" title="soup_session_queue_message ()"><code class="function">soup_session_queue_message</code></a>:
330
330
</p>
385
385
</div>
386
386
<hr>
387
387
<div class="refsect2">
388
 
<a name="id412528"></a><h3>Processing the Response</h3>
 
388
<a name="id531244"></a><h3>Processing the Response</h3>
389
389
<p>
390
390
Once you have received the response from the server, synchronously or
391
391
asynchronously, you can look at the response fields in the
414
414
</div>
415
415
<hr>
416
416
<div class="refsect2">
417
 
<a name="id412637"></a><h3>Intermediate/Automatic Processing</h3>
 
417
<a name="id531352"></a><h3>Intermediate/Automatic Processing</h3>
418
418
<p>
419
419
You can also connect to various <span class="type">SoupMessage</span> signals to do
420
420
processing at intermediate stages of HTTP I/O. Eg, the <a class="link" href="SoupMessage.html#SoupMessage-got-chunk" title='The "got-chunk" signal'><code class="literal">got-chunk</code></a>
440
440
</div>
441
441
<hr>
442
442
<div class="refsect2">
443
 
<a name="id412718"></a><h3>Handling Authentication</h3>
 
443
<a name="id531434"></a><h3>Handling Authentication</h3>
444
444
<p>
445
445
<span class="type">SoupSession</span> handles most of the details of HTTP
446
446
authentication for you. If it receives a 401 ("Unauthorized") or 407
482
482
</div>
483
483
<hr>
484
484
<div class="refsect2">
485
 
<a name="id412854"></a><h3>Multi-threaded usage</h3>
 
485
<a name="id531570"></a><h3>Multi-threaded usage</h3>
486
486
<p>
487
487
The only explicitly thread-safe operations in
488
488
<span class="application">libsoup</span> are <a class="link" href="SoupSessionSync.html" title="SoupSessionSync"><span class="type">SoupSessionSync</span></a>'s
506
506
</div>
507
507
<hr>
508
508
<div class="refsect2">
509
 
<a name="id412944"></a><h3>Sample Programs</h3>
 
509
<a name="id531659"></a><h3>Sample Programs</h3>
510
510
<p>
511
511
A few sample programs are available in the
512
512
<span class="application">libsoup</span> sources: