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

    Class RequestEngine

    Index
    • As getJson, but also reporting the URL the request ended on so that relative links in the body can be resolved against the document they came from.

      query is set on the requested URL and again on every redirect target: a server that redirects a filtered list URL to a path without the query would otherwise answer the unfiltered list, and nothing in the result would say so. A literal + in an OParl timestamp parameter is sent as %2B (see encodeTimestampPlus).

      Credential headers from defaultHeaders go to the origin the request starts at only: a same-origin redirect (relative or absolute Location) keeps them, the http→https upgrade resolveLink allows drops them for the rest of the chain (a 401/403 then says so), and every other origin is refused anyway. The transport is told redirect: "manual"; a response whose url shows the transport followed a redirect to another origin itself fails the request.

      Type Parameters

      • T = unknown

      Parameters

      Returns Promise<JsonResponse<T>>

    • GET an absolute URL and decode the JSON reply. Retries 429/503 (honouring a Retry-After in seconds, capped at 30 s), follows up to maxRedirects redirects on the same host, and rejects non-JSON bodies with an OparlParseError.

      Type Parameters

      • T = unknown

      Parameters

      Returns Promise<T>

    • text without the secret parts of the credential headers in defaultHeaders: server text (an error body that echoes the request) and transport text can carry them. Used for every message the client builds from such text.

      Parameters

      • text: string

      Returns string