Sha256: ea0b7956a06dbf31b2418acb721d00fdf932503fb3c1b28433ccb0125a4cba0e

Contents?: true

Size: 1.53 KB

Versions: 40

Compression:

Stored size: 1.53 KB

Contents

> Synchronous and asynchronous XMLHttpRequest for Node

[![Build Status: Linux](https://travis-ci.org/Mogztter/unxhr.svg?branch=master)](https://travis-ci.org/Mogztter/unxhr) [![install size](https://packagephobia.now.sh/badge?p=unxhr)](https://packagephobia.now.sh/result?p=unxhr)

_unxhr_ is a tiny wrapper of the built-in `http` client to emulate the browser `XMLHttpRequest` object.

**Important:** This library is a fork of [XMLHttpRequest](https://github.com/driverdan/node-XMLHttpRequest).
It was created to be compliant with [XMLHttpRequest Level 2](http://www.w3.org/TR/XMLHttpRequest2/).

## Highlights

- Dependency free
- Asynchronous and synchronous requests
- `GET`, `POST`, `PUT`, and `DELETE` requests
- Binary data using JavaScript typed arrays
- Follows redirects
- Handles `file://` protocol

## Usage

Here's how to include the module in your project and use as the browser-based XHR object.

```js
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](https://github.com/Mogztter/unxhr/issues).

* 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

## License

MIT license. See LICENSE for full details.

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.8.2 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.8.1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.8.0 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.8.0.beta1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.7.4 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.8.0.alpha1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.7.3 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.7.2 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.7.1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.7.0 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.7.0.rc1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.6.1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.6.0 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.6.0.rc1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.6.0.alpha1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.5.1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.5.0 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.5.0.rc1 stdlib/nodejs/node_modules/unxhr/README.md
opal-1.4.1 stdlib/nodejs/node_modules/unxhr/README.md