The config object for configuring the Rettiwt instance.
Makes an HTTP request according to the given parameters.
The requested resource.
The args to be used for the request.
The raw Axios response.
import { FetcherService, ResourceType } from 'rettiwt-api';
// Creating a new FetcherService instance using the given 'API_KEY'
const fetcher = new FetcherService({ apiKey: API_KEY });
// Fetching the details of the User with username 'user1'
fetcher.request(ResourceType.USER_DETAILS_BY_USERNAME, { id: 'user1' })
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err);
});
The base service that handles all HTTP requests.