https://github.com/rajnandigalla/elixor
Observable ( Reactive / Rxjs ) based HTTP client for the browser , reactJs , react native and node.js
https://github.com/rajnandigalla/elixor
http nodejs react-native reactjs rxjs typescript
Last synced: 12 months ago
JSON representation
Observable ( Reactive / Rxjs ) based HTTP client for the browser , reactJs , react native and node.js
- Host: GitHub
- URL: https://github.com/rajnandigalla/elixor
- Owner: RajNandigalla
- License: mit
- Created: 2018-12-04T10:20:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T00:39:02.000Z (over 3 years ago)
- Last Synced: 2025-04-06T13:51:42.533Z (about 1 year ago)
- Topics: http, nodejs, react-native, reactjs, rxjs, typescript
- Language: TypeScript
- Homepage: https://elixor.js.org/
- Size: 2.45 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elixor
### Documentation can be found at https://elixor.js.org/
Observable based HTTP client for the React,Browser and Node.JS
- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser
- Make [http](http://nodejs.org/api/http.html) requests from React , Node.JS
- Intercept request and response using interceptors.
- Transform request and response data
- Cancel requests
- Automatic transforms for JSON data
- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)
## Set up
Using npm:
```bash
$ npm install elixor
```
Using bower:
```bash
$ bower install elixor
```
## Example
Performing a GET Request
```bash
import { elixor } from 'elixor';
elixor.get('https://jsonplaceholder.typicode.com/todos/1')
.subscribe(r => console.log(r));
```
Performing a POST Request
```bash
import { elixor } from 'elixor';
const opt = {
name:'Hello World'
};
elixor.post('https://jsonplaceholder.typicode.com/posts',opt)
.subscribe(r => console.log(r));
```