0.0.1 • Published 2 years ago

http-services-utilities v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

http-services-utilities

This library was generated with Nx.

Running unit tests

Run nx test http-services-utilities to execute the unit tests via Jest.

Running lint

Run nx lint http-services-utilities to execute the lint via ESLint.

This library provides us basic webservices utilities to perform CRUD operations in webapps.

We are using "axios" libarry instaed web browser's "fetch" API.Below are some of the reasons:

  1. Axios enjoys built-in XSRF protection.
  2. Axios request is ok when status is 200 and statusText is ‘OK’, while for Fetch request is ok when
    response object contains the ok property and hence if request ends up with 404 still in fetch it is not consider as error.
  3. Axios performs automatic transforms of JSON data.Fetch is a two-step process when handling JSON data-
    first, to make the actual request; second, to call the .json() method on the response.
  4. Axios allows cancelling request and request timeout.Fetch does not.
  5. Axios has the ability to intercept HTTP requests.Fetch, by default, doesn’t provide a way to intercept requests.
  6. Axios has built-in support for download progress.Fetch does not support upload progress. Axios has wide browser support. Fetch only supports Chrome 42+, Firefox 39+, Edge 14+, and Safari 10.1+ (This is known as Backward Compatibility).