Debian Codegraph @

doc/docstrings/curl_recv_into.rst

raw
1 recv_into(buffer[, nbytes]) -> nbytes
2
3 Receive data from a connection established with ``CONNECT_ONLY`` into
4 *buffer*.
5
6 *buffer* must be a writable bytes-like object.
7
8 If *nbytes* is ``0`` (the default), receive up to ``len(buffer)`` bytes.
9 Otherwise, receive up to *nbytes* bytes. Returns the number of bytes
10 received.
11
12 Raises ``ValueError`` if *nbytes* is negative or larger than ``len(buffer)``.
13
14 Corresponds to `curl_easy_recv`_ in libcurl.
15
16 Because the underlying socket is used in non-blocking mode internally,
17 this method raises ``BlockingIOError`` with ``errno`` set to ``EAGAIN``
18 when libcurl returns ``CURLE_AGAIN``.
19
20 Raises pycurl.error exception upon failures other than ``CURLE_AGAIN``.
21
22 .. _curl_easy_recv: https://curl.se/libcurl/c/curl_easy_recv.html