request -- HTTP client, progress tracking, params parser

request is a chainable XMLHttpRequest wrapper: url() ... response('json') returns a Promise and the request emits onReadyState, progress, load and loadend events. request/http-track-progress patches XMLHttpRequest and fetch globally and renders one aggregated <progress> bar for every transfer. request/params-parser extracts :name placeholders from a path. Click GET data.json and Download large.txt (both files sit next to this page) and edit the inputs of the parser panel -- every output updates live.

GET data.json -- response('json')

idle

status() / statusText() / headers()

--

Parsed JSON rendered as a table

(nothing loaded yet)

Raw JSON

--

onReadyState events

Download large.txt -- progress events

idle

req.on('progress', function (evt, percent) {...}) -- this page's own bar

idle

http-track-progress global bar -- show(container) while the download runs

update events: 0
The module's bar shows the remaining work: it starts full, empties as the tracked requests complete and is removed again with hide() 700 ms after the download.

Event log

Result of response('text')

--

params-parser -- :name placeholders, plus a query-string parser

paramsParser(path, pattern, { fixedEnd: ... })

--

query.parseUrlVars(true) -- nested [] / [key] syntax

--

query.parseUrlVars() -- flat, keys kept as typed

--
Waiting for the request modules...