[](https://travis-ci.com/rearn/axios-digest)
npm install axios-digestaxios-digest is axios add digest auth.
`` sh`
npm install --save axios-digest
)
It pretty much is a wrapper around Axios. the primary or most commonly-used HTTP methods only are available -> POST, PUT, PATCH, GET, DELETE, HEAD. See below for usage upfront (It was inspired from the test file).$3
$3
-
username: Not optional | string.
- password: Not optional | string.
- customAxios: Optional. An existing axios instance | AxiosInstance|AxiosStatic.`js
import AxiosDigest from '.';const username = '[username]';
const passwd = '[pass]';
const base = 'http://localhost';
const axiosDigest = new AxiosDigest(username, passwd);
// Go ahead and make them request!
`$3
#### axiosDigest.info
Interface for setting the username && password beyond the
constructor. It does not include a custom Axios instance as in the constructor.
It receives an object and the fields username && passwd are not Optional, and returns the same, only that the value for field passwd is masked. `js
axiosDigest.info = {username, passwd};
const info = axiosDigest.info; // { username: '[username]', passwd: '*' }
`$3
The HTTP Methods available have been previously highlighted and returns a Promise.
$3
-
path: Not optional | string.
- data: Optional | any.
- config: Optional | AxiosRequestConfig.
#### axiosDigest.head
Makes a
HEAD request.`js
axiosDigest.head(path: string, config?: AxiosRequestConfig): Promise;
`
#### axiosDigest.deleteMakes a
DELETE request.`js
axiosDigest.delete(path: string, config?: AxiosRequestConfig): Promise;
`
#### axiosDigest.getMakes a
GET request.`js
axiosDigest.get(path: string, config?: AxiosRequestConfig): Promise;
`
#### axiosDigest.patchMakes a
PATCH request.`js
axiosDigest.get(path: string, data: any, config?: AxiosRequestConfig): Promise;
`#### axiosDigest.put
Makes a
PUT request.`js
axiosDigest.put(path: string, data: any, config?: AxiosRequestConfig): Promise;
`
#### axiosDigest.postMakes a
POST request.`js
axiosDigest.post(path: string, data: any, config?: AxiosRequestConfig): Promise;
``MIT