0.1.0 • Published 6 years ago

proactive-http-fetch v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

proactive-http-fetch

Proactive http fetch npm library.

Follow these steps:

  • run npm install proactive-http-fetch

Usage

  • 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"
}