Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axios-with-cookies

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-with-cookies

Fork of axios-cookiejar-support with configurable http(s)-agent

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

axios-with-cookies

axios-with-cookies Background-Photo by Lisa Fotios

npm license

axios-with-cookies

This project is a fork of axios-cookiejar-support which lacks the possibility to add configurable http(s)-agents. It is based on the initial work of Masahiro Miyashiro (@3846masa).

Table of Contents

Install

npm install axios tough-cookie axios-with-cookies

Usage

import * as axios from 'axios';
import {AxiosInstance, AxiosStatic} from 'axios';
import {CookieJar, MemoryCookieStore} from 'tough-cookie';
import {wrapper} from 'axios-cookiejar-support';

const axiosInstance: AxiosInstance = ((axios as unknown) as AxiosStatic).create({
  httpsAgent: new HttpsCookieAgent({
    cookies: {
      jar: new CookieJar(new MemoryCookieStore(), {looseMode: true})      
    },
    rejectUnauthorized: false,
    keepAlive: true,
    timeout: 100000
  })
});
this.client = wrapper(axiosInstance);

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

See examples for more details.

Contributing

PRs welcome.

License

MIT (c) maugenst

Keywords

FAQs

Package last updated on 23 Nov 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc