@maschinenlesbar.org/dip-bundestag-cli
    Preparing search index...

    Class RequestEngine

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

      Throws a DipValidationError for a path with a "." or ".." segment: URL parsing would resolve it, so /api/v1/vorgang/. would request the list. The resource methods already reject such an id (idProblem, message Invalid vorgang id: ...); this is the backstop for callers of the engine. (Percent-encoded forms such as "%2e%2e" are safe: encodeURIComponent turns their "%" into "%25".)

      Parameters

      Returns string

    • GET an absolute URL (not under the base URL) with the same policy as every other request: timeout, size cap, 429/503 retry with Retry-After, redirect following with cross-origin credential stripping. A non-2xx answer throws DipApiError (its status says which). obtainKey reads its key sources with this.

      Parameters

      • url: string
      • options: { accept: string; headers?: Record<string, string> }

      Returns Promise<RawResponse>

    • Perform a request with Accept negotiation, transient-error retries and redirect following. headers are added to this request only (after the default headers); credential headers among them are stripped on a cross-origin redirect like the default ones.

      Parameters

      • method: string
      • path: string
      • options: { accept: string; headers?: Record<string, string>; query?: QueryParams } = ...

      Returns Promise<RawResponse>