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 a helper that issues HTTP(S) requests and automatically follows redirect responses while exposing the full redirect chain.
Location header returns the final 200 response body and includes both the original and final URLs in the redirect history. @test@generates
export interface RedirectResult {
status: number;
body: string;
history: string[];
}
export interface RequestOptions {
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
headers?: Record<string, string>;
body?: string | Buffer;
timeoutMs?: number;
}
export function requestWithRedirects(
url: string,
options?: RequestOptions
): Promise<RedirectResult>;Provides a browser-style HTTP request interface with automatic redirect handling.