Skip to main content

Module http

Module http 

Source
Expand description

Thin reqwest wrapper around the studio API.

Every call goes through ApiClient::check, which:

  • emits a structured tracing event on success (debug) and failure (warn) so operators can see what the worker is talking to without having to enable wire-level logging in reqwest (complete also logs the upload byte size before the request so the attempted payload size is visible even when it never finishes), and
  • turns non-2xx responses into an anyhow error tagged with the operation name so the existing log shipper messages stay legible.

Structs§

ApiClient

Functions§

mime_for_ext
Map a binary output’s file extension to the MIME type sent as the multipart complete upload’s Content-Type. Single source of truth: every engine that emits a TaskResult binary extension (synthetic image → png/webp, sd-cpp → webp, tts → wav, synthetic video → webp, the video feature → gif) routes through here, so a new extension can’t silently drift into application/octet-stream and break the studio’s stored content-type.