Client API¶
The MisfinClient is the high-level async client for sending Misfin messages.
MisfinClient¶
MisfinClient ¶
MisfinClient(
timeout: float = REQUEST_TIMEOUT,
port: int = DEFAULT_PORT,
ssl_context: SSLContext | None = None,
trust_on_first_use: bool = True,
tofu_db_path: Path | None = None,
client_cert: Path | str | None = None,
client_key: Path | str | None = None,
max_retries: int = 3,
retry_base_delay: float = 1.0,
misfin_b_fallback: bool = True,
)
Source code in src/titlani/client/session.py
send
async
¶
send(
to: str,
body: str,
subject: str | None = None,
sender: MisfinAddress | None = None,
recipients: list[MisfinAddress] | None = None,
) -> MisfinResponse
Send a message to a Misfin address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
to
|
str
|
Recipient address in "mailbox@hostname" format. |
required |
body
|
str
|
Message body in gemtext format. |
required |
subject
|
str | None
|
Optional subject (prepended as # heading). |
None
|
sender
|
MisfinAddress | None
|
Optional sender address. |
None
|
recipients
|
list[MisfinAddress] | None
|
Optional list of recipient addresses. |
None
|
Source code in src/titlani/client/session.py
send_raw
async
¶
Send pre-formatted message bytes.