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

    Class RequestEngine

    Index
    • GET a path and return the decoded text (a CSV file). Guards against the two common non-CSV replies: an HTML error page (wrong path / the file moved) and an empty body — both surface as a clear BundeswahlParseError rather than reaching the CSV parser.

      NOTE: the response Content-Type is intentionally ignored. The site/CDN serves the CSVs with varying types (text/csv, text/plain, application/octet-stream), so we sniff the body — an <!doctype html> / <html> prefix is the HTML guard — rather than trust the header. Don't "harden" this into Content-Type validation; it would reject valid files.

      Parameters

      Returns Promise<string>

    • Perform a GET with Accept negotiation and transient-error retries. Redirects are NOT followed — a 3xx surfaces as an error.

      Parameters

      • path: string
      • Optionalquery: QueryParams
      • accept: string = "text/csv, text/plain, */*"

      Returns Promise<RawResponse>