proactive-http-fetch
Version:
Proactive http fetch package
31 lines (23 loc) • 850 B
Markdown
Proactive http fetch npm library.
* run npm install proactive-http-fetch
* create a new file http-fetch-test.ts.
```
import { Container } from 'aurelia-dependency-injection';
import { HttpFetch } from 'proactive-http-fetch';
let httpFetch = new Container().get(HttpFetch) as HttpFetch;
httpFetch
.get('https://jsonplaceholder.typicode.com/posts/1')
.then(response => console.log(response));
```
* run tsc http-fetch-client.ts and the result should be:
```
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto"
}
```