@maschinenlesbar.org/govdata-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 (http://user:pw@mirror/...); 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 script's many calls 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 that echoes the request URL or the Authorization header) and transport text (fetch's "Request cannot be constructed from a URL that includes credentials: ") can carry them. The client uses it for its own messages built from server text (a CKAN success: false envelope).

      Parameters

      • text: string

      Returns string