Frest JavaScript REST Client

Installation
To install the core Frest package
1234
|
# using npm. -P is alias of --save-prod in NPM 5.x. Alternatively use --save
npm i -P frest
# using yarn
yarn add frest
|
Or include the UMD build directly in a script tag
1
|
<script type="text/javascript" src="https://unpkg.com/frest"></script>
|
To install official interceptors
1
|
yarn add frest-json frest-auth
|
TODO: More on interceptors
Introduction
Frest is a Browser REST client wrapper of Fetch API with XHR fallback and interceptor support.
Features
- HTTP methods shortcut and CRUD aliases
- XMLHttpRequest fallback, for file download/upload (with progress event) and when Fetch API is not available
- Interceptors to manipulate request/response/error:
- Before request, add additional config for all/some operation before firing the request
- After response, transform response before returning for all/some operation
- Error, catch all error / request retry possibility
- Include UMD build for direct usage in html script tag
- Include TypeScript definition