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%
A lightweight HTTP helper focused on spec-compliant header handling for outgoing requests and response inspection.
X-Trace-Id: abc123), the request includes the header and the returned sentHeaders map exposes it regardless of casing. @testContent-Length) without opting into overrides, that header is omitted from the outgoing request and absent from the sentHeaders map. @testX-Reply-Token: ok-42) and a cookie header, the resolved headers map exposes the custom header case-insensitively and does not surface cookie headers. @test@generates
/**
* Sends an HTTP(S) request with spec-compliant header handling.
*
* @param {string} url - Target endpoint.
* @param {object} [options]
* @param {string} [options.method="GET"] - HTTP method to use.
* @param {Record<string, string>} [options.headers] - Request headers to apply.
* @param {boolean} [options.allowForbiddenHeaders=false] - Whether to permit headers that are normally disallowed.
* @param {string|Buffer} [options.body] - Optional request payload for non-GET/HEAD methods.
* @returns {Promise<{status: number, body: string, headers: Record<string, string>, sentHeaders: Record<string, string>}>}
* Resolves when the request completes with response metadata and normalized header maps.
*/
export async function sendWithHeaders(url, options = {}) {}Node-friendly implementation of the browser request API with header management utilities.
@satisfied-by