http-local-auth
Installation
npm install --save http-local-auth
Usage
;
And inject the service to the constructor:
{ ...
And you can use all request type provided: GET, POST, PATCH, PUT and DELETE
HttpLocalAuth;
Adding custom headers
HttpLocalAuth;
Note
By default, 'Accept': 'application/json'
and 'Content-Type': 'application/json'
headers are already added. Also, the Authorization
header is being appended every request with a value from localStorage
item token
.