From 17219507bf869463c750977572282090ad43c201 Mon Sep 17 00:00:00 2001 From: TPV Date: Sun, 19 Jul 2026 09:28:22 -0700 Subject: [PATCH] added requiring call sites to set own content-type for anything other than json(aioweb doesn't set content-type properly) --- src/monitor_utils/sessions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/monitor_utils/sessions.py b/src/monitor_utils/sessions.py index 7ef5eb2..a1b729d 100644 --- a/src/monitor_utils/sessions.py +++ b/src/monitor_utils/sessions.py @@ -84,10 +84,11 @@ async def send_request( url: Request URL. method: HTTP method. params: Query parameters. - json_data: JSON body. A dict here is sent as a JSON body. - data: Alternative body. Note aioweb routes any dict or list to a JSON - body, so true form-encoding requires a pre-encoded string; a form - dict passed here is sent as JSON. + json_data: JSON body. A dict here is sent as JSON with the + application/json content-type set by aioweb. + data: Raw request body, passed through unchanged (e.g. a url-encoded + form string). The caller owns the matching content-type via headers. + A dict is JSON-encoded by aioweb, so use json_data for JSON bodies. headers: Per-request headers merged over the session defaults. Returns: