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

    Class RequestEngine

    Index
    bigIntegerKeys: ReadonlySet<string>

    EngineOptions.bigIntegerKeys, copied.

    • Build a fully-qualified URL from a path and optional query parameters. It keeps the base URL's userinfo; request() leaves it out and sends it as an Authorization header instead (see basicAuthorization).

      Parameters

      Returns string

    • Perform a GET expecting JSON: the parsed value, the URL that answered (after any redirects, userinfo redacted) and the request as an error message names it, GET <url> (cut at MAX_MESSAGE_VALUE_LENGTH). Every error about the answer starts with that request (GET <url>: the answer is not valid JSON.), so a log of a run over many portals tells which one failed; the client prefixes its own envelope and shape errors with it too.

      The text is never changed silently: bytes that are not valid in the charset, and lone surrogates written as JSON escapes (\ud800), are replaced with U+FFFD, so the result is well-formed text (jq rejects a lone surrogate, and with it the whole output), and onWarning is told how many. One bad character never sinks a whole answer.

      Type Parameters

      • T

      Parameters

      Returns Promise<{ request: string; url: string; value: T }>

    • text without the base URL's credentials (raw and percent-decoded, and the forms a server echoes them back in: echoedCredentialForms): server text (an error body or a CKAN error that echoes the request URL) and transport text (fetch's "Failed to fetch ") can carry them. The client uses it for its own messages built from server text.

      Parameters

      • text: string

      Returns string