Socket
Socket
Sign inDemoInstall

axios-cookiejar-support

Package Overview
Dependencies
25
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-cookiejar-support

Add tough-cookie support to axios.


Version published
Maintainers
1
Weekly downloads
200,211
decreased by-3.99%

Weekly downloads

Readme

Source

axios-cookiejar-support

axios-cookiejar-support

github sponsors 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 .

FAQ

  • Q. Why can't I assign the httpAgent / httpsAgent?
    • A. axios-cookiejar-support uses httpAgent / httpsAgent to read and write cookies. If other Agents are assigned, cookies cannot be read/written.
  • Q. I want to use it with another Agent (e.g., http-proxy-agent).
    • A. Consider using http-cookie-agent. axios-cookiejar-support also uses http-cookie-agent. Read http-cookie-agent's README for more details.

Contributing

PRs accepted.

License

MIT (c) 3846masa

Keywords

FAQs

Last updated on 14 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc