http-local-auth
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i http-local-auth

Weekly Downloads

1

Version

1.0.5

License

MIT

Last publish

Collaborators

  • shiftescape