apipost-send
TypeScript icon, indicating that this package has built-in type declarations

0.0.76 • Public • Published

A-Design Logo

apipost-send 是一个适用于 Node.js 的人性化的 HTTP 请求库

安装

npm i apipost-send

基础使用

需引入:

import ASend from 'apipost-send';
let apiPostSend=new ASend(Options);
apiPostSend.request(apiPostApiJson).then((data)=>{
  console.log("success",data);
}).catch(err=>{
  console.log('error',err);
});

Options type:Object

参数 类型 默认值 参数描述
maxrequstloop Number 5 最大重定向次数
followRedirect Number true 是否允许重定向 1 允许 -1 不允许
timeout Number 0 接口超时时间
proxy object {} 代理对象
proxyAuth string username:password 代理账号密码
https Object {} 证书相关
https 默认
{ 
  "rejectUnauthorized": -1, // 忽略错误证书 1 -1
  "certificateAuthority": '', // ca证书地址
  "certificate": '', // 客户端证书地址
  "key": '', //客户端证书私钥文件地址
  "pfx": '', // pfx 证书地址
  "passphrase": '' // 私钥密码
}

开源协议

apipost-send 遵循 MIT 协议

Package Sidebar

Install

npm i apipost-send

Weekly Downloads

13

Version

0.0.76

License

MIT

Unpacked Size

86.6 kB

Total Files

6

Last publish

Collaborators

  • chengyang12138
  • proud_lion
  • lee-meng
  • wjzhangq
  • apipost-lab001
  • xbw19975