1.3.3 • Published 3 years ago

helper-xhr v1.3.3

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

Helper XHR

Very basic, very simple, xhr promise wrapper. I started using fetch, and soon discovered "replay xhr" is not supported in browsers for fetch request.

So I created this miny/simple/basic xhr request wrapper.

Installation

npm install helper-xhr

There's no dependecy.

Yes it's in ES6.

Usage

import HttpRequest from 'helper-xhr';

var xhr = new HttpRequest("POST", "/foo/bar/", "application/json");
xhr.send({elmer: "fudd"}).then((data) => {
	console.log("got this", data.json);
}).catch((e) => {
	console.log("something wrong", e);
});

console.log("headers", xhr.getAllResponseHeaders());

Contributing

You are welcome!

History

Created on March 22, 2017

Credits

Don't blame me.

License

Do whatever you want with it.

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago