@maschinenlesbar.org/marktstammdatenregister-cli
    Preparing search index...

    Class RequestEngine

    Index
    • GET a path with query params and parse the JSON reply into T. Every MaStR endpoint answers with a JSON document, so an empty body or a 204 is a MastrParseError, never a silent null.

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

    • Perform a GET with Accept negotiation and transient-error retries. Redirects are NOT followed — the canonical host answers directly, so a 3xx (e.g. a bad base URL bouncing to a portal page) surfaces as an error.

      The engine enforces the transport contract itself, so it holds for a custom transport too: timeoutMs (an AbortSignal deadline), maxResponseBytes (checked on the body it gets back), any byte-array body, Headers/Map/any-case headers. Whatever a transport throws becomes a MastrNetworkError, and so does a malformed response; a reset connection (isTransientNetworkError) is retried like a 503.

      Parameters

      • path: string
      • Optionalquery: QueryParams
      • accept: string = "application/json"

      Returns Promise<RawResponse>

    • text without the base URL's credentials: server text (an error body that echoes the request URL, the Authorization header or the decoded user:password) and transport text (fetch's "Failed to fetch ") can carry them. The client runs it on the Errors envelopes it turns into errors.

      Parameters

      • text: string

      Returns string