13.3 Accessing JavaScript from Prolog
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Using SWI-Prolog in your browser (WASM)
        • Accessing JavaScript from Prolog
          • :=/2
          • is_object/1
          • is_object/2
          • js_script/2
          • fetch/3
          • Asynchronous access to JavaScript from Prolog
          • JavaScript Promise that can be aborted
    • Packages
fetch(+URL, +Type, -Data)
Wrapper around JavaScript fetch(), conversion of the Response object and waiting for the Promise. Type is an atom or string that is used as method on the Response object. Examples are text, json, html or blob. The blob type returns the Data as a string of bytes, i.e., character codes in the range 0 ... 255.