@3846masa/axios-cookiejar-support 中文文档教程
axios-cookiejar-support
< img src="https://flat.badgen.net/npm/v/axios-cookiejar-support" alt="npm">
为 axios 添加 tough-cookie
支持。
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');
有关详细信息,请参阅示例。
Extended Request Config
import type { CookieJar } from 'tough-cookie';
declare module 'axios' {
interface AxiosRequestConfig {
jar?: CookieJar;
}
}
另请参阅 https://github.com/axios/axios#request-config 。
Contributing
接受 PR。
License
axios-cookiejar-support
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
更多
你可能也喜欢
- @00farol/conversational-form 中文文档教程
- @24hr/progressive-loadable 中文文档教程
- @36node/catcm-library-core-sdk 中文文档教程
- @4c/fast-sass-loader 中文文档教程
- @7isys/loopback-sdk-builder 中文文档教程
- @7y1o/localize 中文文档教程
- @a6kme/create-npm-package 中文文档教程
- @a73/get-all-files-ts 中文文档教程
- @a8k/plugin-react 中文文档教程
- @aarnet/jupyterlab-ext-changeconf 中文文档教程