1.1.1 • Published 5 years ago

@thorbens/axios-fetcher v1.1.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
5 years ago

Axios Fetcher

Description

This package implements a fetcher using the axios library.

Use

const fetcher = new AxiosFetcher();
const response = await fetcher.fetch("http://google.com");
const body = response.body; // contains the raw response body

Post example:

const fetcher = new AxiosFetcher();
const options: FetchOptions = {
    data: {
        foo: `bar`,
    },
    method: Method.POST,
};
const response = await fetcher.fetch("https://httpbin.org/post", options);
const json = response.asJSON<MyResponseObject>(); // contains the data returned as json object
1.1.1

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago