ne_read_response_to_fd.3 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. '\" t
  2. .\" Title: ne_read_response_to_fd
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 23 November 2025
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.36.0
  8. .\" Language: English
  9. .\"
  10. .TH "NE_READ_RESPONSE_TO_" "3" "23 November 2025" "neon 0.36.0" "neon API reference"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. ne_read_response_to_fd, ne_read_response_to_buffer \- read a response body
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_request\&.h>
  37. .fi
  38. .ft
  39. .HP \w'int\ ne_read_response_to_fd('u
  40. .BI "int ne_read_response_to_fd(ne_request\ *" "req" ", int\ " "fd" ");"
  41. .HP \w'int\ ne_read_response_to_buffer('u
  42. .BI "int ne_read_response_to_buffer(ne_request\ *" "req" ", char\ *" "data" ", size_t\ *" "buflen" ");"
  43. .SH "DESCRIPTION"
  44. .PP
  45. To read an HTTP response body the functions
  46. \fBne_read_response_to_fd\fR
  47. and
  48. \fBne_read_response_to_buffer\fR
  49. can be used\&. These functions are wrappers for
  50. \fBne_read_response_block\fR
  51. and must be called only after
  52. \fBne_begin_request\fR
  53. has been called successfully for the request\&.
  54. .PP
  55. The
  56. \fBne_read_response_to_fd\fR
  57. function writes the response body content to the file descriptor passed as the
  58. \fIfd\fR
  59. parameter\&.
  60. .PP
  61. The
  62. \fBne_read_response_to_buffer\fR
  63. function writes the response body content to the buffer passed as the
  64. \fIbuf\fR
  65. parameter, which has length passed via the *\fIbuflen\fR
  66. parameter\&. On success, the *\fIbuflen\fR
  67. is updated with the number of bytes written to the buffer\&.
  68. .PP
  69. After the response body has been read successfully,
  70. \fBne_end_request\fR
  71. must be called\&. If a failure occurs while reading the response body, the connection must be closed using
  72. ne_close_connection\&.
  73. .SH "RETURN VALUE"
  74. .PP
  75. Both functions return zero on success, or an
  76. NE_* error code
  77. on failure\&. The
  78. \fBne_read_response_to_buffer\fR
  79. function returns
  80. NE_FAILED
  81. if the response message length is larger than the buffer length\&.
  82. .SH "HISTORY"
  83. .PP
  84. \fBne_read_response_to_buffer\fR
  85. is available in neon 0\&.36\&.0 and later\&.
  86. .SH "SEE ALSO"
  87. .PP
  88. ne_request_create,
  89. ne_set_error
  90. .SH "COPYRIGHT"
  91. .br
  92. Copyright \(co 2001-2025 Joe Orton
  93. .br