@3846masa/axios-cookiejar-support

Add tough-cookie support to axios.

Stats

StarsIssuesVersionUpdatedCreatedSize
@3846masa/axios-cookiejar-support
23114.0.2a month ago6 years agoMinified + gzip package size for @3846masa/axios-cookiejar-support in KB

Readme

axios-cookiejar-support

axios-cookiejar-support

npm license standard-readme compliant

Add tough-cookie support to axios.

Table of Contents

Install

npm install axios tough-cookie axios-cookiejar-support

Usage

import axios from 'axios';
import { wrapper } from 'axios-cookiejar-support';
import { CookieJar } from 'tough-cookie';

const jar = new CookieJar();
const client = wrapper(axios.create({ jar }));

await client.get('https://example.com');

See examples for more details.

Extended Request Config

import type { CookieJar } from 'tough-cookie';

declare module 'axios' {
  interface AxiosRequestConfig {
    jar?: CookieJar;
  }
}

See also https://github.com/axios/axios#request-config .

Contributing

PRs accepted.

License

MIT (c) 3846masa

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.