A Node.js package that implements the W3C XMLHttpRequest specification, enabling browser-like HTTP client functionality.
xhr2 is an XMLHttpRequest emulator for Node.js that implements the W3C XMLHttpRequest specification. It allows developers to use the browser's familiar XMLHttpRequest API in Node.js applications for making HTTP and HTTPS requests, bridging the gap between client-side and server-side JavaScript networking.
Node.js developers who need a browser-compatible HTTP client API, particularly those porting browser code to Node.js or writing isomorphic JavaScript that shares networking logic between client and server.
xhr2 provides a standards-compliant XMLHttpRequest implementation with Node.js-specific extensions, offering a more familiar interface than Node's native `http` module while maintaining compatibility with the W3C specification.
XMLHttpRequest emulator for node.js
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the core XMLHttpRequest API according to the W3C specification, enabling seamless porting of browser code to Node.js with minimal changes.
Adds Node.js-specific extensions like Buffer support in send() and responseType, and network configuration via nodejsSet, enhancing server-side usability beyond browser APIs.
Accepts String, ArrayBufferView, and Buffer data types in send(), and supports text, json, arraybuffer, and buffer response types, offering versatile data exchange options.
Automatically follows HTTP redirects, simplifying request handling without requiring manual intervention or additional code.
Lacks implementation of standard features like FormData, Blob, synchronous operations, and CORS, which limits full browser API compatibility and may require workarounds.
Does not support upload progress events, making it unsuitable for applications that need real-time monitoring of file uploads or large data transfers.
Officially tested only on Node.js 10 and 12, which may raise compatibility concerns with newer Node.js versions, despite not being a hard requirement.