<!-- ** Transfer Encodings

     $Id: sect_transfer.docbook 822 2005-08-16 14:52:51Z ewald-arnold $
-->

<sect1 id="transfer-coding">
<title>Transfer Encoding via &http;</title>

<sect2 id="chunked-coding">
<title>Chunked Encoding</title>

<para>Chunked encoding is used when the overall length is not yet
known when the transmission starts. This may happen when scripts are
processed or multimedia data is transfered. &ulxmlrpcpp; supports chunked
encoding for both directions though it usually only makes sense for
replies.</para>

<para>To turn on chunked encoding for &http; the following lines are
needed:

<programlisting>

  TcpIpConnection conn (false, host, port);
  HttpProtocol prot(conn.get());
  prot.setChunkedTransfer(true);

</programlisting>

<note>
  <title>Chunked Encoding over Proxies</title>
  <para>Please take into account that not all &http; proxies
  support chunked encoding in both directions.
  <ulink url="http://www.squid-cache.org">Squid</ulink> for example refuses
  chunked encoding in client requests with error 501.
  </para>
</note>

</para>

</sect2>

</sect1>
