Synchronous and asynchronous XMLHttpRequest for Node
unxhr is a tiny wrapper of the built-in
http client to emulate the browser
- Dependency free
- Asynchronous and synchronous requests
- Follows redirects
Here's how to include the module in your project and use as the browser-based XHR object.
const XMLHttpRequest = require('unxhr').XMLHttpRequest const xhr = new XMLHttpRequest()
Known Issues / Missing Features
For a list of open issues or to report your own visit the github issues page.
- Local file access may have unexpected results for non-UTF8 files
- Synchronous requests don't set headers properly
- Synchronous requests freeze node while waiting for response (But that's what you want, right? Stick with async!).
- Some events are missing, such as abort
- Cookies aren't persisted between requests
- Missing XML support
MIT license. See LICENSE for full details.