reqbody.xml 2.5 KB

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