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

    Class RequestEngine

    Index
    • Build a fully-qualified URL from a path and optional query parameters.

      Throws an AusbildungValidationError for a path with a "." or ".." segment, percent-encoded forms included ("%2e", ".%2e", "%2E%2E"). URL parsing resolves either form as a dot segment, so a path built from .. would request /pc/v1/ with the X-API-Key attached. details already accepts digits-only ids (offerIdProblem); this is the backstop for every other caller of the engine.

      Parameters

      Returns string

    • GET an absolute http(s) URL, outside the base URL, with the same request policy as every other request: timeout, size cap, 429/503 retries, redirects with credential stripping, and the User-Agent and default headers. Used by obtainKey(), which builds an engine without an API key. Rejects with an AusbildungValidationError for a URL that is not http(s) (httpUrlProblem).

      Parameters

      • url: string
      • accept: string

      Returns Promise<RawResponse>

    • Perform a GET expecting JSON and parse it into T. The accept header defaults to application/json but can be overridden per endpoint (e.g. the search collection serves HAL+JSON and 406s on plain application/json).

      Type Parameters

      • T

      Parameters

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

      Returns Promise<T>