tessl install tessl/npm-xmlhttprequest@1.8.0XMLHttpRequest for Node.js that emulates the browser XMLHttpRequest object
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.15x
Baseline
Agent success rate without this tile
65%
Implement an async HTTP helper that relies on the dependency's lifecycle notifications to expose how a request progresses from start to completion.
http://localhost:4000/ping that responds with status 200 and body "pong", capture each state code from the first transition after starting the request through completion in order [1, 2, 3, 4], and include that log in the resolved result. @teststatus (200), body ("pong"), and the full state log; do not resolve on intermediate state changes. @test@generates
/**
* Starts an async HTTP GET request to the given URL.
* @param {string} url
* @param {(state: number, log: number[]) => void} [onStateChange] optional observer for lifecycle transitions
* @returns {Promise<{ status: number, body: string, states: number[] }>} resolves when the request finishes, rejects if aborted
*/
export function trackLifecycle(url, onStateChange);
/**
* Aborts the in-flight request started by trackLifecycle, if any.
*/
export function abortActive();Use the dependency-provided evented HTTP client to drive lifecycle tracking.