From 9aee0b1d79f34e42eddbfc03921cb716fb9a05f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Mon, 20 Oct 2025 21:54:35 +0100 Subject: [PATCH] Add Usage block to RequestHandler --- beetsplug/_utils/requests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/beetsplug/_utils/requests.py b/beetsplug/_utils/requests.py index 9245b08a3..e4d4a7b2d 100644 --- a/beetsplug/_utils/requests.py +++ b/beetsplug/_utils/requests.py @@ -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