1.0.5 • Published 7 years ago

http-local-auth v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

http-local-auth

version downloads PRs Welcome MIT License

Installation

npm install --save http-local-auth

Usage

import { HttpLocalAuthService } from 'http-local-auth';

And inject the service to the constructor:

constructor (private HttpLocalAuth: HttpLocalAuthService) { ...

And you can use all request type provided: GET, POST, PATCH, PUT and DELETE

HttpLocalAuth.get('/path-to-api-endpoint-or-file').subscribe((successCallback) => {
    // do something
}, (errorCallback) => {
    // do something
});

Adding custom headers

HttpLocalAuth.addHeaders({<key>, <value>});

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.

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago