kubernetes_asyncio icon indicating copy to clipboard operation
kubernetes_asyncio copied to clipboard

The documentation refers urllib3.HTTPResponse which is now replaced by the aiohttp.ClientResponse

Open nnseva opened this issue 4 months ago • 0 comments

Problem description

Since the aiohttp is used, the documentation erroneously refers to the urllib3 and synchronous request execution, like here.

Details

ApiClient.call_api() wrong description

The following is written:

Makes the HTTP request (synchronous) and returns deserialized data.

To make an async_req request, set the async_req parameter.

Although the call_api is a synchronous function by itself, the returned value is a __call_api() awaitable, so the request execution is actually asynchronous (using aiohttp in the following steps).

BTW I'm not sure that the async_req parameter (and corresponding request pooling inside the multiprocessing pool) is necessary yet.

_preload_content parameter wrong description

Actually, the _preload_content=False leads to returning the aiohttp.ClientResponse instead of the urllib3.HTTPResponse as wrongly referred by the documentation in many places, and messes up the reader who is going to create the result streaming or something like this.

BTW it's useful to create some parameter or interface to have the (asynchronous) iterateable structured output instead of lists.

nnseva avatar Sep 03 '25 08:09 nnseva