Add Usage block to RequestHandler

This commit is contained in:
Šarūnas Nejus 2025-10-20 21:54:35 +01:00
parent 71b20ae6f6
commit 9aee0b1d79
No known key found for this signature in database

View file

@ -92,6 +92,17 @@ class RequestHandler:
conversion of standard HTTP errors to beets-specific exceptions. Supports
custom session types and error mappings that can be overridden by
subclasses.
Usage:
Subclass and override :class:`RequestHandler.session_type`,
:class:`RequestHandler.explicit_http_errors` or
:class:`RequestHandler.status_to_error()` to customize behavior.
Use :class:`RequestHandler.get()` or
:class:`RequestHandler.fetch_json()` for common operations, or
:class:`RequestHandler.request()` for full control over HTTP methods.
Feel free to define common methods that are used in multiple plugins.
"""
session_type: ClassVar[type[TimeoutSession]] = TimeoutSession