
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
@blued-core/http-client
Advanced tools
基于 request 的一层封装。
npm i @blued-core/http-client
cache 与 qconf-conf 组件都为可选的,可以自己根据描述自定义
使用方式:
import HttpClient from '@blued-core/http-client'
import Cache from '@blued-core/cache'
import { QconfHost } from '@blued-core/qconf-conf'
const qconfConf = new QconfHost({
host1: 'XXX'
})
// Cache 可以使用 Map 代替
const httpClient = new HttpClient(qconfConf, new Cache())
const httpClient1 = httpClient.getClient('host1')
async function main () {
const res = await httpClient1.getData({
url: 'path1/path2',
qs: { id: 1 }
})
console.log(res)
}
main()
调用参数与request
参数一致,提供如下八个方法:
基于method
抽出来的四个方法:get
、post
、put
、delete
。
基于以上四个方法的基础上处理返回值的四个方法:getData
、postData
、putData
、deleteData
。
httpClient.get({
url: 'XXX'
}) // => { code: 200, data: 'Hello World' }
httpClient.getData({
url: 'XXX'
}) // => 'Hello World'
FAQs
基于 request 的一层封装。
We found that @blued-core/http-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.