XMLHttpRequest for Node.js that emulates the browser XMLHttpRequest object
Overall
score
75%
Ensures configuration values are fetched in a blocking manner before application startup continues.
{ "feature": "on" }, returns a result containing status 200, body text, and a parsed data object while blocking until the response is fully available. @testmaintenance, returns a result reflecting status 503 and the raw body instead of throwing a generic error, still using a blocking request. @test@generates
export interface SyncResponse {
status: number;
body: string;
data?: unknown;
}
export function fetchConfigSync(url: string, headers?: Record<string, string>): SyncResponse;
export function postConfigSync(url: string, payload: string, headers?: Record<string, string>): SyncResponse;
export function fetchAllSync(urls: string[], headers?: Record<string, string>): SyncResponse[];Provides blocking HTTP(S) requests using a browser-compatible client, including synchronous mode suitable for boot-time flows. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-xmlhttprequestdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10