1 <refentry id="refreqbody"> 2 3 <refmeta> 4 <refentrytitle>ne_set_request_body_buffer</refentrytitle> 5 <manvolnum>3</manvolnum> 6 </refmeta> 7 8 <refnamediv> 9 <refname id="ne_set_request_body_buffer">ne_set_request_body_buffer</refname> 10 <refname id="ne_set_request_body_fd">ne_set_request_body_fd</refname> 11 <refname id="ne_set_request_body_fd64">ne_set_request_body_fd64</refname> 12 <refpurpose>include a message body with a request</refpurpose> 13 </refnamediv> 14 15 <refsynopsisdiv> 16 17 <funcsynopsis> 18 19 <funcsynopsisinfo>#include <ne_request.h></funcsynopsisinfo> 20 21 <funcprototype> 22 <funcdef>void <function>ne_set_request_body_buffer</function></funcdef> 23 <paramdef>ne_request *<parameter>req</parameter></paramdef> 24 <paramdef>const char *<parameter>buf</parameter></paramdef> 25 <paramdef>size_t <parameter>count</parameter></paramdef> 26 </funcprototype> 27 28 <funcprototype> 29 <funcdef>int <function>ne_set_request_body_fd</function></funcdef> 30 <paramdef>ne_request *<parameter>req</parameter></paramdef> 31 <paramdef>int <parameter>fd</parameter></paramdef> 32 <paramdef>off_t <parameter>begin</parameter></paramdef> 33 <paramdef>off_t <parameter>length</parameter></paramdef> 34 </funcprototype> 35 36 </funcsynopsis> 37 38 </refsynopsisdiv> 39 40 <refsect1> 41 <title>Description</title> 42 43 <para>The <function>ne_set_request_body_buffer</function> 44function specifies that a message body should be included with the 45body, which is stored in the <parameter>count</parameter> bytes buffer 46<parameter>buf</parameter>.</para> 47 48 <para>The <function>ne_set_request_body_fd</function> function 49can be used to include a message body with a request which is read 50from a file descriptor. The body is read from the file descriptor 51<parameter>fd</parameter>, which must be a associated with a seekable 52file (not a pipe, socket, or FIFO). <parameter>count</parameter> 53bytes are read, beginning at offset <parameter>begin</parameter> 54(hence, passing <parameter>begin</parameter> as zero means the body is read 55from the beginning of the file).</para> 56 57 <para>For all the above functions, the source of the request 58 body must survive until the request has been dispatched; 59 neither the memory buffer passed to 60 <function>ne_set_request_body_buffer</function> nor the file 61 descriptor passed to 62 <function>ne_set_request_body_fd</function> are copied 63 internally.</para> 64 65 </refsect1> 66 67 <refsect1> 68 <title>See also</title> 69 70 <para><xref linkend="ne_request_create"/></para> 71 </refsect1> 72 73 </refentry> 74