• Stars
    star
    312
  • Rank 134,133 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Add tough-cookie support to axios.

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

More Repositories

1

upload-gphotos

Upload photo to Google Photos (Unofficial).
TypeScript
263
star
2

http-cookie-agent

Allows cookies with every Node.js HTTP clients (e.g. Node.js global fetch, undici, axios, node-fetch).
TypeScript
41
star
3

cheerio-gasify

cheerio working on Google Apps Script.
JavaScript
38
star
4

lit-date

Light-weight, faster datetime formatter for modern browsers.
JavaScript
37
star
5

node-linebot

LINE BOT API wrapper for Node.js
TypeScript
32
star
6

stylelint-browser-compat

Yet another linter rule to detect compatibility of CSS features.
TypeScript
24
star
7

kauntah-svg

A simple hit counter inspired by shimobayashi/kauntah.
JavaScript
15
star
8

wasm-zip-extractor-app

JavaScript
11
star
9

blurhash-sw

The BlurHash API provided by ServiceWorker.
TypeScript
9
star
10

memi

Simple task-runner with JavaScript
JavaScript
9
star
11

the-camera

The camera powered by modern browser PWA
JavaScript
7
star
12

babel-plugin-polyfill-custom

Yet another babel plugin that lets you freely customize polyfills.
TypeScript
5
star
13

smtp2slack

The system forwarding email to slack.
JavaScript
4
star
14

docker-ngrokd

Make your private ngrok with docker-compose.
3
star
15

template-thesis

卒論書くときに使った Paperist / LaTeX テンプレート
TeX
3
star
16

sauce-han-fonts

醤ノ角ゴシック / 醤ノ明朝 ( Japanese TrueType fonts converted from Source Han Sans / Source Han Serif. )
3
star
17

SUSH

Simple URL Shortener (can be provided from a static HTML server)
TypeScript
3
star
18

dockerfile-mailserver

Dockerfile to make mailserver powered by postfix / dovecot .
Shell
3
star
19

configs

JavaScript
2
star
20

bmp

Create a BMP (w/ alpha channel) binary from RGBA raw bytes like ImageData.
JavaScript
2
star
21

http-signature

Create / Verify HTTP Signatures (https://tools.ietf.org/html/draft-cavage-http-signatures-10)
TypeScript
2
star
22

portfolio

TypeScript
2
star
23

rpgmv-save-store-proxy

[DO NOT WORK] RPGツクールMVで作られたゲームのセーブデータを保管して, どの端末でも同じセーブデータを使えるようにします.
JavaScript
2
star
24

waifu2x-matlab

very slow.
MATLAB
1
star
25

HeyMeijiSystem

Chrome Extension for Oh-o!MeijiSystem.
JavaScript
1
star
26

github-repo-manager-with-react

GitHub Repositories Manager with React.
TypeScript
1
star
27

docker-nginx-omniauth-adapter

Docker image Slack/GitHub auth adapter using sorah/nginx_omniauth_adapter.
Ruby
1
star
28

passport-annict

TypeScript
1
star
29

stylelint-yet-another-no-restricted-syntax

Yet another stylelint rule to disallow specified syntax, similar to ESLint no-restricted-syntax.
1
star