Package API: konnect.curl

exception CurlError(code: int, msg: str)[source]

Bases: Exception

An error exception for Curl transfers

The value of ‘code’ is a Curl CURLE_* value, for instance CURLE_COULDNT_CONNECT. The value of ‘msg’ is an error message returned by curl_easy_strerror with ‘code’ passed as an argument.

property code: int
property msg: str
class Multi[source]

Bases: object

A wrapper around CurlMulti to bind it with Anyio-supported event frameworks

Users should treat this class as a black-box. Only the Multi.process() method is available. There are no other methods or attributes they should attempt to call or modify as doing so will have undefined results.

async process(request: konnect.curl.abc.RequestProtocol[konnect.curl._multi.U, konnect.curl._multi.R]) konnect.curl._multi.U | konnect.curl._multi.R[source]

Perform a request as described by a Curl instance

class Request(url: str, destination: IO[bytes])[source]

Bases: object

A simple implementation of RequestProtocol

url: str
destination: IO[bytes]
configure_handle(handle: konnect.curl.abc.ConfigHandle, /) None[source]

Set options on a Curl instance to be used for this request

has_update() bool[source]

Return whether calling Request.get_update() will return a value or raise LookupError

get_update() None[source]

Return a waiting update or raise LookupError if there is none

See Request.has_update() for checking for waiting updates.

completed(handle: konnect.curl.abc.GetInfoHandle, /) None[source]

Indicate that Curl has completed processing the handle and return a final response

class Time(*values)[source]

Bases: kodo.quantities.QuantityUnit

Units for time intervals

MILLISECONDS = 1
SECONDS = 1000

Subpackages

Submodules