brk-code

curl_cffi の API リファレンス

curl_cffi (lexiforest/curl_cffi) の公開 API 116 件 —— クラス 44、関数 14、メソッド 58。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: lexiforest/curl_cffi

種別件数
クラス44
関数14
メソッド58

API 一覧

classcurl_cffi.aio.AsyncCurl
Wrapper around curl_multi handle to provide asyncio support.
methodcurl_cffi.aio.AsyncCurl.add_handle(curl:Curl)
Add a curl handle to be managed by curl_multi.
methodcurl_cffi.aio.AsyncCurl.remove_handle(curl:Curl)
Cancel a future for given curl handle.
methodcurl_cffi.aio.AsyncCurl.set_result(curl:Curl)
Mark a future as done for given curl handle.
methodcurl_cffi.aio.AsyncCurl.setopt(option, value)
Wrapper around curl_multi_setopt.
funccurl_cffi.aio.timer_function(curlm, timeout_ms:int, clientp:Any) -> int
see: https://curl.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html
funccurl_cffi.cli.parse.parse_request_items(items:list[str]) -> ParsedItems
Parse request items into structured data.
funccurl_cffi.cli.parse.process_url(url:str) -> str
Normalise a URL: localhost shortcut, default scheme.
funccurl_cffi.cli.pro.add_pro_parsers(subparsers) -> None
Register update, list, and config subcommands.
funccurl_cffi.cli.pro.handle_pro_command(args) -> bool
Handle pro subcommands.
classcurl_cffi.cli.run.HttpFileRequest
A single request parsed from an .http file.
funccurl_cffi.cli.run.handle_run(args:argparse.Namespace) -> None
Execute batch requests.
funccurl_cffi.cli.run.parse_http_file(text:str) -> list[HttpFileRequest]
Parse an .http file into a list of requests.
classcurl_cffi.const.CurlFollow
``CURLFOLLOW_*`` consts for redirect behavior
classcurl_cffi.curl.Curl
Wrapper for ``curl_easy_*`` functions of libcurl.
methodcurl_cffi.curl.Curl.debug() -> None
Set debug to True
methodcurl_cffi.curl.Curl.duphandle() -> Curl
Wrapper for ``curl_easy_duphandle``.
methodcurl_cffi.curl.Curl.getinfo(option:CurlInfo) -> bytes | int | float | list[str | int]
Wrapper for ``curl_easy_getinfo``.
methodcurl_cffi.curl.Curl.impersonate(target:str, default_headers:bool=True) -> int
Set the browser type to impersonate.
methodcurl_cffi.curl.Curl.parse_cookie_headers(headers:list[bytes]) -> SimpleCookie
Extract ``cookies.SimpleCookie`` from header lines.
methodcurl_cffi.curl.Curl.parse_status_line(status_line:bytes) -> tuple[CurlHttpVersion, int, bytes]
Parse status line.
methodcurl_cffi.curl.Curl.pause(action:int) -> int
Pause or resume data transfer on this handle.
methodcurl_cffi.curl.Curl.perform(clear_headers:bool=True, clear_resolve:bool=True) -> None
Wrapper for ``curl_easy_perform``, performs a curl request.
methodcurl_cffi.curl.Curl.reset() -> None
Reset all curl options, wrapper for ``curl_easy_reset``.
methodcurl_cffi.curl.Curl.setopt(option:CurlOpt, value:Any) -> int
Wrapper for ``curl_easy_setopt``.
methodcurl_cffi.curl.Curl.version() -> bytes
Get the underlying libcurl version.
methodcurl_cffi.curl.Curl.ws_close(code:int=1000, message:bytes=b'') -> int
Close a websocket connection.
methodcurl_cffi.curl.Curl.ws_recv() -> tuple[bytes, CurlWsFrame]
Receive a frame from a websocket connection.
methodcurl_cffi.curl.Curl.ws_send(payload:bytes | memoryview, flags:CurlWsFlag | int=CurlWsFlag.BINARY) -> int
Send data to a websocket connection.
classcurl_cffi.curl.CurlError
Base exception for curl_cffi package
classcurl_cffi.curl.CurlMime
Wrapper for the ``curl_mime_`` API.
methodcurl_cffi.curl.CurlMime.addpart(name:str, *content_type:str | None=None, *filename:str | None=None, *local_path:str | bytes | Path | None=None, *data:bytes | None=None) -> None
Add a mime part for a mutlipart html form.
methodcurl_cffi.curl.CurlMime.attach(curl:Curl | None=None) -> None
Attach the mime instance to a curl instance.
methodcurl_cffi.curl.CurlMime.close() -> None
Close the mime instance and underlying files.
funccurl_cffi.curl.bytes_to_hex(b:bytes, uppercase:bool=False) -> str
Convert a bytes object to a space-separated hex string, e.g.
funccurl_cffi.curl.debug_function(curl, type_:int, data, size:int, clientp) -> int
ffi callback for curl debug info
funccurl_cffi.curl.slist_to_list(head) -> list[bytes]
Converts curl slist to a python list.
classcurl_cffi.fingerprints.FingerprintUpdateError
Raised when fingerprint update fails.
funccurl_cffi.fingerprints.get_fingerprint(target:str) -> Fingerprint
Return a deep-copied fingerprint that callers can edit safely.
methodcurl_cffi.requests.cache.CacheBackend.should_cache_request(request:Request, *stream:bool=False, *content_callback:Any=None) -> bool
XXX: streamed content is not cached.
classcurl_cffi.requests.cookies.Cookies
HTTP Cookies, as a mutable mapping.
methodcurl_cffi.requests.cookies.Cookies.clear(domain:Optional[str]=None, path:Optional[str]=None) -> None
Delete all cookies.
methodcurl_cffi.requests.cookies.Cookies.delete(name:str, domain:Optional[str]=None, path:Optional[str]=None) -> None
Delete a cookie by name.
methodcurl_cffi.requests.cookies.Cookies.get(name:str, default:Optional[str]=None, domain:Optional[str]=None, path:Optional[str]=None) -> Optional[str]
Get a cookie by name.
methodcurl_cffi.requests.cookies.Cookies.set(name:str, value:str, domain:str='', path:str='/', secure=False) -> None
Set a cookie value by name.
classcurl_cffi.requests.exceptions.CertificateVerifyError
Raised when certificate validated has failed
classcurl_cffi.requests.exceptions.ConnectionError
A Connection error occurred.
classcurl_cffi.requests.exceptions.ContentDecodingError
Failed to decode response content.
classcurl_cffi.requests.exceptions.CookieConflict
Same cookie exists for different domains.
classcurl_cffi.requests.exceptions.DNSError
Could not resolve
classcurl_cffi.requests.exceptions.HTTPError
An HTTP error occurred.
classcurl_cffi.requests.exceptions.ImpersonateError
The impersonate config was wrong or impersonate failed.
classcurl_cffi.requests.exceptions.IncompleteRead
Incomplete read of content
classcurl_cffi.requests.exceptions.InterfaceError
A specified outgoing interface could not be used.
classcurl_cffi.requests.exceptions.InvalidHeader
The header value provided was somehow invalid.
classcurl_cffi.requests.exceptions.InvalidJSONError
A JSON error occurred.
classcurl_cffi.requests.exceptions.InvalidProxyURL
The proxy URL provided is invalid.
classcurl_cffi.requests.exceptions.InvalidURL
The URL provided was somehow invalid.
classcurl_cffi.requests.exceptions.JSONDecodeError
Couldn't decode the text into json.
classcurl_cffi.requests.exceptions.MissingSchema
The URL scheme (e.g.
classcurl_cffi.requests.exceptions.ProxyError
A proxy error occurred.
classcurl_cffi.requests.exceptions.RequestException
Base exception for curl_cffi.requests package
classcurl_cffi.requests.exceptions.RequestsWarning
Base warning for Requests.
classcurl_cffi.requests.exceptions.RetryError
Custom retries logic failed.
classcurl_cffi.requests.exceptions.SSLError
An SSL error occurred.
classcurl_cffi.requests.exceptions.SessionClosed
The session has already been closed.
classcurl_cffi.requests.exceptions.StreamConsumedError
The content for this response was already consumed.
classcurl_cffi.requests.exceptions.Timeout
The request timed out.
classcurl_cffi.requests.exceptions.TooManyRedirects
Too many redirects.
classcurl_cffi.requests.exceptions.URLRequired
A valid URL is required to make a request.
classcurl_cffi.requests.headers.Headers
HTTP headers, as a case-insensitive multi-dict.
methodcurl_cffi.requests.headers.Headers.get(key:str, default:Any=None) -> Any
Return a header value.
methodcurl_cffi.requests.headers.Headers.get_list(key:str, split_commas:bool=False) -> list[Optional[str]]
Return a list of all header values for a given key.
methodcurl_cffi.requests.headers.Headers.items() -> ItemsView[str, Optional[str]]
Return `(key, value)` items of headers.
classcurl_cffi.requests.models.Request
Representing a sent request.
classcurl_cffi.requests.models.Response
Contains information the server sends.
methodcurl_cffi.requests.models.Response.acontent() -> bytes
wait and read the streaming content in one bytes object.
methodcurl_cffi.requests.models.Response.atext() -> str
Return a decoded string.
methodcurl_cffi.requests.models.Response.charset() -> str
Alias for encoding.
methodcurl_cffi.requests.models.Response.is_redirect() -> bool
Whether this response is a well-formed redirect.
funccurl_cffi.requests.request(method:HttpMethod, url:str, thread:Optional[ThreadType]=None, curl_options:Optional[dict]=None, debug:Optional[bool]=None, **kwargs:Unpack[RequestParams]) -> Response
Send an http request.
methodcurl_cffi.requests.session.AsyncSession.close() -> None
Close the session.
methodcurl_cffi.requests.session.AsyncSession.loop() -> asyncio.AbstractEventLoop
Returns a reference to event loop.
classcurl_cffi.requests.session.Session
A request session, cookies and connections will be reused.
methodcurl_cffi.requests.session.Session.close() -> None
Close the session.
methodcurl_cffi.requests.session.Session.ws_connect(url:str, on_message=None, on_error=None, on_open=None, on_close=None, **kwargs) -> WebSocket
Connects to a websocket url.
classcurl_cffi.requests.utils.NotSetType
Unique single initialized type distinct from ``None``.
funccurl_cffi.requests.utils.is_absolute_url(url:str) -> bool
Check if the provided url is an absolute url
funccurl_cffi.requests.utils.requote_uri(uri:str) -> str
Re-quote the given URI.
classcurl_cffi.requests.websockets.AsyncWebSocket
An asyncio WebSocket implementation using libcurl.
methodcurl_cffi.requests.websockets.AsyncWebSocket.flush(timeout:float | None=None) -> None
Waits until all items in the send queue have been processed.
methodcurl_cffi.requests.websockets.AsyncWebSocket.loop() -> asyncio.AbstractEventLoop
Get a reference to the running event loop
methodcurl_cffi.requests.websockets.AsyncWebSocket.ping(payload:str | bytes) -> None
Send a ping frame.
methodcurl_cffi.requests.websockets.AsyncWebSocket.recv(*timeout:float | None=None) -> tuple[bytes, int]
Receive a WebSocket message.
methodcurl_cffi.requests.websockets.AsyncWebSocket.recv_json(*loads:Callable[[str], T]=json_loads, *timeout:float | None=None) -> T
Receive a JSON frame.
methodcurl_cffi.requests.websockets.AsyncWebSocket.recv_str(*timeout:float | None=None) -> str
Receive a text frame.
methodcurl_cffi.requests.websockets.AsyncWebSocket.send(payload:str | bytes | bytearray | memoryview, flags:CurlWsFlag | int=CurlWsFlag.BINARY, timeout:float | None=None) -> None
Send a WebSocket message.
methodcurl_cffi.requests.websockets.AsyncWebSocket.send_binary(payload:bytes) -> None
Send a binary frame.
methodcurl_cffi.requests.websockets.AsyncWebSocket.send_bytes(payload:bytes) -> None
Send a binary frame, alias of :meth:`send_binary`.
methodcurl_cffi.requests.websockets.AsyncWebSocket.send_json(payload:object, *dumps:Callable[..., str]=json_dumps) -> None
Send a JSON frame.
methodcurl_cffi.requests.websockets.AsyncWebSocket.send_str(payload:str) -> None
Send a text frame.
classcurl_cffi.requests.websockets.AsyncWebSocketContext
Helper to enable simpler context manager usage
classcurl_cffi.requests.websockets.WebSocket
A WebSocket implementation using libcurl.
methodcurl_cffi.requests.websockets.WebSocket.close(code:int=WsCloseCode.OK, message:bytes=b'')
Close the connection.
methodcurl_cffi.requests.websockets.WebSocket.ping(payload:str | bytes) -> int
Send a ping frame.
methodcurl_cffi.requests.websockets.WebSocket.recv() -> tuple[bytes, int]
Receive a frame as bytes.
methodcurl_cffi.requests.websockets.WebSocket.recv_json(*loads:Callable[[str], T]=json_loads) -> T
Receive a JSON frame.
methodcurl_cffi.requests.websockets.WebSocket.recv_str() -> str
Receive a text frame.
methodcurl_cffi.requests.websockets.WebSocket.run_forever(url:str='', **kwargs) -> None
Run the WebSocket forever.
methodcurl_cffi.requests.websockets.WebSocket.send(payload:str | bytes, flags:CurlWsFlag=CurlWsFlag.BINARY) -> int
Send a data frame.
methodcurl_cffi.requests.websockets.WebSocket.send_binary(payload:bytes) -> int
Send a binary frame.
methodcurl_cffi.requests.websockets.WebSocket.send_json(payload:object, *dumps:Callable[..., str]=json_dumps) -> int
Send a JSON frame.
methodcurl_cffi.requests.websockets.WebSocket.send_str(payload:str) -> int
Send a text frame.
classcurl_cffi.requests.websockets.WebSocketClosed
WebSocket is already closed.
classcurl_cffi.requests.websockets.WebSocketError
WebSocket-specific error.
classcurl_cffi.requests.websockets.WebSocketTimeout
WebSocket operation timed out.

この情報について

掲載しているシグネチャは lexiforest/curl_cffi の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る